TobusBoulton
TobusBoulton

Reputation: 181

ASP.NET + Linq to SQL

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.

Upvotes: 0

Views: 139

Answers (1)

Panu Oksala
Panu Oksala

Reputation: 3438

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

Upvotes: 1

Related Questions