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

Top 5 Contributors of the Month
Post New Web Links

Can't debug classes in App_Code folder

Posted By:      Posted Date: September 08, 2010    Points: 0   Category :ASP.Net
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.

View Complete Post

More Related Resource Links

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

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?


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!

Workflow --> After Build --> 3rd Party DLL in Debug Folder --> What to do?

hey, im referencing a third party dll; after the build of the workflow, theres an other dll created in the debug folder of the project which is required by the other dll   but, when im deploying the workflow, it seems, that dll is not deployed, too, cause the workflow crashes, cause this dll is required   so how can i tell the workflow, where to find this dll?

App_Code Folder



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


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.



"Release" folder vs. "Debug" Folder. What is the impact & how to do it.


Hi Folks,

I have few questions regarding Debug vs. Release mode.

1) How to compile a application so that it lands in "Release" folder vs. "Debug" Folder.& how to do it. What is the impact or difference between Debug vs. Release mode

I ask this question for C++ & C-sharp applications/dlls.

2) Also, Can I used "Release" mode Reference dlls in an Application which itself is going to be complied in Debug mode.

Thank you


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?



Learning C# and OOP, Classes

This is the second lesson in a miniseries designed to teach you how to write object-oriented programs using C#. This miniseries will describe and discuss the necessary and significant aspects of object-oriented programming (OOP) using C#.

InterFaces and Abstract Classes

Link Describes About Abstraction and Interfaces In Breif

MSDN Abstract Classes Link

MSDN Reference For Abstract Clases

Debug implementation of URLrewriter.net



After some googling and help from the forum, I have integrated the the URLrewrting.net in my project. There are no error when I build the project, but the URL rewriting does not work. I am able to figure ot where the problem is. Is there a way to debug this. The code is as below:

 Web.config file

<?xml version="1.0"?>
    Note: As an alternative to hand editing this file you can use the 
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in 
    machine.config.comments usually located in 
		<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
			<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
				<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.W

Relation between classes in c# with class diagrams



Can anyone provide me an example of one to one and one two many relationship between classes in c# with class diagram and explationation.

Foundations: Extending the WPF Animation Classes


Learn what the WPF Animation Classes can do, what they can't, and how to extend them.

Charles Petzold

MSDN Magazine July 2007

CLR Inside Out: New Library Classes in "Orcas"


The next version of Visual Studio currently code-named "Orcas"supports advanced encryption algorithms, Elliptic curve cryptography, big integers, and other security enhancements. The CLR team explains.

Mike Downen, Inbar Gazit, and Justin Van Patten

MSDN Magazine April 2007

Debug Leaky Apps: Identify And Prevent Memory Leaks In Managed Code


When is the .NET Garbage Collector unable to reclaim memory? The answer might surprise you. Stay tuned.

James Kovacs

MSDN Magazine January 2007

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