Compiler Error Message: CS0246: The type or namespace name 'Acme'

Dear Friends,

I am receiving the error shown below while importing namespace with C#.

Can someone tell me where am I going wrong.


****************************************************************
****************************************************************

Server Error in '/' Application.
--------------------------------------------------------------------------------

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0246: The type or namespace name 'Acme' could not be found (are you missing a using directive or an assembly reference?)

Source Error:



Line 2: <%@ Import Namespace="System.Data.SqlClient" %>
Line 3: <%@ Import Namespace="System.Globalization" %>
Line 4: <%@ Import Namespace="Acme" %>
Line 5:
Line 6:


Source File: c:inetpubwwwrootsamplessample5.aspx Line: 4


c:inetpubwwwrootsamplessample5.aspx(4,11): error CS0246: The type or namespace name 'Acme' could not be found (are you missing a using directive or an assembly reference?)

****************************************************************
****************************************************************



Comments

  • : Dear Friends,
    :
    : I am receiving the error shown below while importing namespace with C#.
    :
    : Can someone tell me where am I going wrong.
    :
    :
    : ****************************************************************
    : ****************************************************************
    :
    : Server Error in '/' Application.
    : --------------------------------------------------------------------------------
    :
    : Compilation Error
    : Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
    :
    : Compiler Error Message: CS0246: The type or namespace name 'Acme' could not be found (are you missing a using directive or an assembly reference?)
    :
    : Source Error:
    :
    :
    :
    : Line 2: <%@ Import Namespace="System.Data.SqlClient" %>
    : Line 3: <%@ Import Namespace="System.Globalization" %>
    : Line 4: <%@ Import Namespace="Acme" %>
    : Line 5:
    : Line 6:
    :
    :
    : Source File: c:inetpubwwwrootsamplessample5.aspx Line: 4
    :
    :
    : c:inetpubwwwrootsamplessample5.aspx(4,11): error CS0246: The type or namespace name 'Acme' could not be found (are you missing a using directive or an assembly reference?)
    :
    : ****************************************************************
    : ****************************************************************
    :
    :
    :
    :


    What you need to do is right click on references in the Solution explorer and add a refference to the dll containing that namespace. Let me know if this works....

  • I am experiencing the same problem on my new PC.
    On my old PC, just added the DLL reference and placed the DLL in bin directory, it works.

    On my new PC, I register my DLL with regasm successfully, I can execute a desktop application that references the DLL fine. Compile and reference the dll fine in visual studio but fail at run time. The runtime error is the compile error you mentioned.

    Smells like an IIS configuration ?

    CT
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories