Solved

Codes problem

Posted on 2014-09-16
3
572 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.

770 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