locked
The type or namespace name could not be found (are you missing a using directive or an assembly reference?) RRS feed

  • Question

  • User-1307167327 posted

    In that cls_Index file i cant able to properties.. Give me suggestion for this error.. .

    Tuesday, June 18, 2013 2:26 AM

Answers

All replies

  • User1786028798 posted

    Please follow below steps.

    1] I think your App_Code folder is not in root folder of project.Please make shure that you have put App_code folder in project path which contains default.aspx file.Don't keep App_code within a nested folder.

    2] Right click on the .cs file in the App_Code folder and check its properties. Make sure the Build Action is set to Compile

    3] Try to access like "ProjectNamespaceName.App_Code.cls_Index

    Tuesday, June 18, 2013 2:38 AM
  • User-1373950060 posted

    Hi,

    You need to add a reference in your project to an assembly where that namespace is defined.

    If you are using VS.NET:

    1.  Right click on the References folder on your project.

    2.  Select Add Reference.

    3.  Select the .NET tab (or select the Browse button if it is not a .NET Framework assembly).

    4.  Double-click the assembly containing the namespace in the error message.

    5.  Press the OK button.

    If you are using the command line, use the /r: or /reference: option.  For Example:

    csc.exe /reference:System.Drawing.dll MyFontDisplayApp.cs 

    More details please reference: http://blogs.msdn.com/b/csharpfaq/archive/2004/04/29/why-did-i-receive-the-error-the-type-or-namespace-lt-namespace-name-gt-does-not-exist-in-the-class-or-namespace-lt-parent-namespace-gt-are-you-missing-an-assembly-reference.aspx

    Hope that's helpful.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 18, 2013 10:52 PM