Solved

Codes problem

Posted on 2014-09-16
3
554 Views
Last Modified: 2014-09-17
Hi,
Here are the codes
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web;
using System.Web.UI;

namespace EBAAct2
{
    [ComVisible(true)]  // This is a requirement.
    [ProgId("EBAActDLL")] // The ProgId attribute is a requirement.
    [Guid("2194675D-E373-4c83-92EE-754B5F665095")]  // Hua Min to generate another GUFeat and set it here.
    public class Class1
    {
        public Class1()
        {
        }

        public string MenuFeat
        {
            get
            {
                return m_strMenuFeat;
            }

            set
            {
                m_strMenuFeat = value;
            }
        }

        public string OptionFeat
        {
            get
            {
                return m_strOptionFeat;
            }

            set
            {
                m_strOptionFeat = value;
            }
        }

        public string UserFeat
        {
            get
            {
                return m_strUserFeat;
            }

            set
            {
                m_strUserFeat = value;
            }
        }
        private string m_strMenuFeat;
        private string m_strOptionFeat;
        private string m_strUserFeat;
    }
}

Open in new window

How to resolve these errors?

Error	1	The type or namespace name 'Tasks' does not exist in the namespace 'System.Threading' (are you missing an assembly reference?)	C:\proj\EBAAct2\EBAAct2\Class1.cs	5	24	EBAAct2
Error	2	The type or namespace name 'UI' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)	C:\proj\EBAAct2\EBAAct2\Class1.cs	7	18	EBAAct2
Error	3	The type or namespace name 'ComVisible' could not be found (are you missing a using directive or an assembly reference?)	C:\proj\EBAAct2\EBAAct2\Class1.cs	11	6	EBAAct2
Error	4	The type or namespace name 'ComVisibleAttribute' could not be found (are you missing a using directive or an assembly reference?)	C:\proj\EBAAct2\EBAAct2\Class1.cs	11	6	EBAAct2
Error	5	The type or namespace name 'ProgId' could not be found (are you missing a using directive or an assembly reference?)	C:\proj\EBAAct2\EBAAct2\Class1.cs	12	6	EBAAct2
Error	6	The type or namespace name 'ProgIdAttribute' could not be found (are you missing a using directive or an assembly reference?)	C:\proj\EBAAct2\EBAAct2\Class1.cs	12	6	EBAAct2
Error	7	'System.Guid' is not an attribute class	C:\proj\EBAAct2\EBAAct2\Class1.cs	13	6	EBAAct2

Open in new window

0
Comment
Question by:HuaMinChen
3 Comments
 
LVL 2

Expert Comment

by:Akilandeshwari N
Comment Utility
Hope you are targeting to .NET 3.5 which does not have this library. Make sure to target to .NET 4.0 in the project properties and try.
0
 
LVL 10

Author Comment

by:HuaMinChen
Comment Utility
Sorry, to target framework, .Net 4.0 is not available. I'm using VS 2008 on Win 7 machine.
0
 
LVL 11

Accepted Solution

by:
louisfr earned 500 total points
Comment Utility
The posted code doesn't use most of the 'using' directives you have.
You could remove all the 'using' lines and replace them with:
using System;
using System.Runtime.InteropServices;

Open in new window

0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seveā€¦
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now