Solved

Cannot add App_code .cs file to the solution

Posted on 2011-03-08
4
787 Views
Last Modified: 2013-12-17
I have a Shared code file database.cs in App_code folder. The solution was built on .NET 2.0 framework. Everything was working fine, untill few minutes ago, I copied the files, created a new folder and opened the folder as a new Web Site. When I was prompted to upgrade from .NET 2.0 to .NET 4.0, I said Yes.

Now for some reason, database.cs file in App_code folder is not getting included in the solution. When I include the namespace defined inside it abc.xyz.data, while debugging, I get an error  Error 7      The type or namespace name 'NeboWeb' could not be found (are you missing a using directive or an assembly reference?)

Seems like .cs files stored in App_code file is not recognized in other files of the solution.

This thing is not just happening in the new project I created by copying the old working Website folder (straight from inetpub), but even the original folder, which I didn't even touched is not working either.

Any idea, why is this happening !
0
Comment
Question by:pratz09
  • 2
4 Comments
 
LVL 5

Expert Comment

by:mayankagarwal
ID: 35070676
the app_code folder should be at the root. Please check the same
0
 

Author Comment

by:pratz09
ID: 35071153
It is at the root level. Thanks,
0
 
LVL 5

Accepted Solution

by:
jijeesh earned 500 total points
ID: 35071339
0
 

Author Closing Comment

by:pratz09
ID: 35071532
Build action: compile property was off. Turned it on and it works now. Thanks.
0

Featured Post

The New “Normal” in Modern Enterprise Operations

DevOps for the modern enterprise offers many benefits — increased agility, productivity, and more, but digital transformation isn’t easy, especially if you’re not addressing the right issues. Register for the webinar to dive into the “new normal” for enterprise modern ops.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question