.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

App_Code Folder

Posted By:      Posted Date: September 23, 2010    Points: 0   Category :ASP.Net


I have created a C# Web Site in Visual Studio 2008 with an App_Code Folder that contains 2 classes.

Both classes have their namespace set to App_Code and my aspx.cs files include the reference to App_Code.

When I run the app from VS the site compiles and runs fine but when I try to run it from my Windows 7's IIS install I get an error that it cannot find the App_Code Namespace.

I did find a solution here: http://forums.asp.net/p/1181651/3945778.aspx but it does not seem to work in VS2008.

I someone has seen this issue and can direct me to a solution that would be great.

Let me know if I should be for detailed


View Complete Post

More Related Resource Links

Can't debug classes in App_Code folder

I've gone through the forum and I've googled this issue and I'm surprised by how little information I've found.  I recently converted my ASP.NET 1.x project to ASP.NET 2 and I've found that while debugging I cannot step into code stored in the App_code folder.  This is a serious problem for me as something is broken and I can't discover the source without my trusty debugger.  Please, does anyone have a resolution for this issue.  I understand that it is related to the fact that the App_Code folder is compiled dynamically but surely there must be some way of debugging the classes in there :-( I have debug="true" in my config file, all my projects are building in the Debug configuration.  Breakpoints in the aspx files work fine, but then any code reference to a class in App_Code is stepped over by the debugger. Thanks very much for your help.

can the App_Code folder of a project contain both C# and VB# classes (in 1 proj)

Using vb.net/asp.net 2005.I have a project that is done with all vb.net, however I want to get some more experience with C#.Net.I am considering creating a new database class to put in the app_code folder, I am thinking that this is allowable and will work but just wanted to check to see if anyone else has tried something similar. thanks

Why does a class in the App_Code folder get ignored by the compiler?



I've noticed that with some, but not all sites, if I add a class in a .cs file in the App_Code folder, then I can't reference the class anywhere. In some sites, this isn't a problem. If I move the .cs file to the root, then no problem.

Anyone able to explain what's going on here? I have a mixture of sites created in VS2010, along with ones that existed before I got it. Don't know if this makes any difference.

More to the point, how do I persuade VS2010 (and I suppose IIS ultimately) to allow .cs files in App_Code, as I find this much neater than having class files littered around the root.


can't create new mdf file in App_Code folder


I just installed vwd express 2008 and SSE 2008.  For SSE i setup a default installation (i.e. SQLEXPRESS as the default instance name etc). 

In VWD when i right-click on the "App_Data" folder and select "Add New Item--->SQL Server Database" i get the following message:

"  Connections to SQL Server files (*.mdf) require SQL Server Express 2005 to function properly.  Please verify the installation of the component or download from the URL: ............."

So to get around that what i've done is select the "Database Explorer" tab and right-click on "Connections--->Add Connection".  This process works for me but the other doesn't.  Any idea why?

One problem with the 2nd approach is now that database appears in the database explorer for any project i have open in VWD.  Again any idea why thats happening?

 If anyone could offer a suggestion as to why i can't add a new connection in the solution explorer as explained above that would be fantastic.

 Also - i don't know if it matters but i'm running a 64-bit version of vista and have installed the x64 version of SSE.



Files in App_Code folder unavailable in VS2010



I am stuck and unable to continue with my project.

I have...

.NET 4.0
Vista 64bit
Web Project

I created an App_Code folder and placed code modules/classes into it... BUT now I am unable to get to any of the files and the directory is NOT showing up in the intelisense.

I have tried...

Using Suma2.App_Code;  -  FAILED
Suma2.App_Code SAC = new Suma2.App_Code;  -  FAILED

Gor any suggestions or thoughts?



Copying files to a folder on web server



I have few files in FolderA on the web server.

I want the users to select a fews files from FolderA and copy them to FolderB on the same web server.

I want to list all the files in FolderA and allow the user to select a few files and copy.

I want to copy the files programatically when the user selects a few files and click on Copy button.

How to copy the files quickly from folderA to FolderB?




Classes created inside App_Code dir is ignored by the compiler



I have the following problem programming in asp .net with visual studio 2008. If I insert a new class file, right clicking on "add new element -> class -> ecc..." directly inside the App_Code directory (or in its any subdirectory) the compiler and the smartTab do not see any custom namespace previously created in other classes, nor from other classes I can find the namespace and the class name defined within the new class file just inserted. The only way I found to correctly insert a new class file is create it right clicking on "add new element... ecc..." not in the App_Code (or sub) directory but rather in the root node with the name of the entire project, and then I can move it in the destination App_Code subdirectory, and it keeps working.

As a matter of facts it seems that is not important where the file IS but rather where I CREATED it: if I created a class from inside the App_Code it does not see anything and it is not seen by any other class, otherwise if I create it right clicking on the root node of the project it works and keeps workng even moving inside any subdir within the project.

I also tried to manually add the App_Code subdirs to the <Compilation> and <codeSubDirectories> tags of the Web.config file, but anything changed with this behaviour.

Does anybody know why?


Do not see the table in Database after moving the project folder



I created a ASP.NET project under Visual Web Developer 2008. Under that project I had a Database (along with ASPNETDB.MDF) which has about 3/4 tables (I had SQL server 2008). Everything was working fine (like insert, delete, etc.). And I was able to view the tables in database explorer view.

Then I had to format my computer for some reason and I copied the whole project in a USB drive and then after formatting the computer I copied the folder and tried to open it in Visual Web Developer (now I have VWD 2010). I can see the both Database under App_Data folder (ASPNETDB.mdf and the DB I created). ASPNETDB has all the tables and data as expected. But I do not see the tables under the DB I created.

I also tried in one of my friends computer who has Visual Web Developer 2008. But same result.

I am just wondering if anyone can help me with retreiving the table. I have a bad feeling that I might needed to do something to backup the data (not sure though). But the tables should be still there ... isn't it ?

Any help will be appreciated. Thank you in advance.

Question about user used to execute code from app_code


 Hello. I would like to know something about code execution  in App_Code folder.

Under wich user executed code from app_code.

I'm using impersonate in web.config

Exclude Folder from Website in Visual Studio


For projects such as forms apps and class libraries you can exclude folders which reside in the directory from the project. That menu option does not seem to exist when you create a website in VS 2005, is there any way to do it?



Access Classes in an aspx page that is in folder in asp.net


I have classes in App_Code:
Connection.cs, ClientData.cs ....

I have a folder Authenticated within it have an aspx page Client.aspx

How do I access the page through Client.aspx ClientData.cs the class, because there is a mistake for me to define the class as I do, please help me!

Cannot add an article to the specified folder



I've set up a sharepoint knowledgebase on my intranet site and all seemed fine.

The problem I have is that if I create a subfolder, I cannot create articles in that subfolder, as they appear in the root.


Steps taken:

  1. New|Folder - create a new folder in the knowledge base root
  2. Enter the folder
  3. New|Knowledge Base Article
  4. Verify that the path on the top of the new article edit page is "...Knowledge Base > New Folder"
  5. Save article
  6. Verify New Folder is empty and article can be found in the root of the knowledge base  

Uploading an article to the new folder is fine, as is editing/deleting the new folder itself.

Any ideas?



When try to open a folder in a moss 2007 document library in Explorer View, the folder does not open


When try to open a folder in a moss 2007 document library in Explorer View, the folder does not open.

I am using IE7 and the path of the folder does not contains more than 100 characters.

Also it opening on few on the machines which has IE7.


Changing folder name loses Person attributes


I have a custom folder content type. These folders have several attributes including text fields, choice, dates, and person lookups from AD. When I change the folder name, the folder will keep its date, choice and text box attributes, but lose the person attributes. If I change it back to its old name then it regains the person attributes. The ID is stays the same. One of the person fields is a required field, but that it still saves as an empty field. If anyone has a work around or even a suggestion as to what might be causing this it would help a lot.

navagation menu from folder structure?


Hello there,

If I have a folder structure that a user can place documents into, how do I create a navmenu that populates its  subfolder based on the contents of its corresponding subfolder in the folder structure? For instance if I have a menu item named "Forms" and I want it to get all the documents out of a folder named "Forms" (In which these documents are populated by a user placing them in there)


Hopefully I explained with enough detail, thanks for any help guys.




Access denied to folder in ASP.NET project either though I have granted all users full permissions !



i have made a very simple file upload app, that i want users to be able to upload images to a folder on my server, well localhost for the time being Stick out tongue

here is the simple upload code...

        protected void ButtonRegisterDetails_Click(object sender, EventArgs e) 
            // display properties of the uploaded file 

Create user is creating aspxxxx.mdf database in my app_data folder


I had already setup roles for my pages and requirements call for ability to manage and create users.

So i was looking at code that allows you to do so using membership, even though i got the page to work, it was creating a database in my app_data folder.. i already have SQLExpress setup with the asp schema, but cant figure out how to get my application to use that instead of creating the db in the folder?

What am i missing or doing wrong?

I have the following setup in my web.config file..

		<authentication mode="Windows"/>
			<deny users="?"/>
        <add name="SqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend