Intellisense missing in App_Code, for bin dll in website project

Any classes created in /App_Code or /App_Code/[subfolder] do not have local intellisense.

That is - I have intellisense for system dlls like string. [member] etc. But it cannot force it to scan any classes local to App_Code (including itself), or dll referenced in the / bin folder.

Although I have intellisense inside the scope-function. (i.e. local variables or function parameters)

NB

  • This is a website project, not a web application project.
  • I tried to reset all Visual Studio settings and clear the intellisense information found in AppData for VS.
  • Im working with Visual Studio 2012 ver. 11.0.61030.00 Update 4
  • The project uses .NET 4.0
  • If I move classes outside of the App_code folder, they are perfectly registered in intellisense.
  • It is not possible to set the file assembly option for compilation because it is a website project, not a web application.
+6
source share
2 answers

IMO, you have to move the code from App_Code . In .net 4.5 (and 4.0), your code is compiled into a DLL, so I don’t see any benefits for entering code in App_Code . If someone advises different, I am interested to hear.

With this in mind, create a folder or folders under your root project and place your code there.

 MyWebsite - DataLayer MyDataLayer.cs Default.aspx 

In this example, you can access your DataLayer.MyDataLayer classes

Better yet, create a new library for code that is not needed in your aspx.cs code for the files.

+2
source

The new code files in App_Code will have a Content assembly action, so you don't have intellisense. So, right-click your code file and click "Properties", in the properties window, change "Build Action" to "Compile".

Then open the code file again.

+2
source

All Articles