0

I have a class in my App_Code directory that I'm trying to initialize from the root directory of my solution but it is not showing up in IntelliSense. I have tried changing the class's build action from Content to Compile but then IntelliSense throws a whole bunch of errors about not finding my DBML class.

Note DBML file, Class and aspx file are all in the same namespace.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Linq;

^ Imports on class that I'm trying to initialize. (May be irrelevant)

Any pointers in the right direction would be appreciated.

2
  • Are there build errors if you attempt to build? There might be an error with the class itself that isn't displaying in intellisense. Commented Jun 5, 2015 at 16:56
  • 1
    You need to make sure that “Build Action” of none of the files in the App_Code folder is marked as “Compile” Commented Jun 5, 2015 at 17:01

1 Answer 1

1

You need to make sure that Build Action of none of the files in the App_Code folder is marked as Compile.

But this will bring its own side effects that intellisense may not work very well for these files inside VS as they will not be treated as Class files by VS… But the key point is that you do not really need “App_Code in Web Application Projects (WAP) if you do not intend to put random code files or modify existing code files in App_Code folder directly on your production server…

http://vishaljoshi.blogspot.fi/2009/07/appcode-folder-doesnt-work-with-web.html

Sign up to request clarification or add additional context in comments.

1 Comment

Thats interesting because most places I read App_Code is the place for classes etc. Thanks for your input.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.