Solved

Codes problem

Posted on 2014-09-16
3
583 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
ID: 40327388
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
ID: 40327412
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
ID: 40327421
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.

685 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