.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

Debug and Release Buids

Posted By:      Posted Date: September 16, 2010    Points: 0   Category :.NET Framework
I have a solution containing a windows forms application and a class library.  The windows forms application has a reference to the class library project.  When I build the project, it fails to find the class library output.  Looking closer at this, it appears that VS.NET is looking for the debug build, but the class library has been built in release mode.Since I have no idea how to switch between debug and release (used to be a toolbar option) I would have assumed that since I must be in debug mode, VS.NET would have built both in debug mode and no problems.  So why has it built my class library in release mode and attempt to build my forms application in debug mode, then fail because it can't find the debug version of the class library?Help much appreciated.

View Complete Post

More Related Resource Links

How to set different references in debug and release mode

I have a C# application end a C# assembly. I can compile both in release and debug version. In the C# application I'd like to refer the release assembly version in release mode and the debug version for the debug.
Is it possible? In VS 2005 you have just one list of references for both release and debug.

"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


References in debug vs release mode



I am developing a web site in Visual Studio 2008. I have a project for the web application and several class libraries as references. When I add the references I select the file under bin/debug in the class library folder. When changing the project to release mode the references still point to the .dll in the debug folder. Shouldn't this change automatically. How should I add the references so that debug and release are properly referenced?

Best regards, Janhe

Dynamically Set Web Reference based on DEBUG and RELEASE modes

I ran into a problem today that took me a while to figure out (for the second time) and wanted to post it since I'm sure I'm not the only one to want to accomplish this. The problem is, I reference a web service from my application but the web service I want to use is on a different server than the one used in the production environment. Specifcally, I wanted to be able to run my web service on my local machine without having to manually change my web reference back and forth between the production URL and my localhost URL and risk forgetting to point it back to the correct server before releasing an update to production. Here's what I did to accomplish that:

  1. Set my Web Reference URL to my local URL in the properties window.
  2. Set the Web Reference URL Behavior to Dynamic. This lets the URL to be read from the project's AppSettings at runtime.
  3. Now that we're using the AppSettings as our URL, we can set that value at runtime as long as our setting is scoped at the User level and not the Application level. In the project, I opened Properties>Settings.settings and for the row with my Web Reference URL , changed Scope to User.
  4. From that window you can click the View Code button to open Settings.cs. I added this code to the constructor though, you could update the setting value elsewhere if needed:


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

Editor's Note: A Large Release Wave is Headed your Way


This month Howard Dierking discusses the coverage of Windows Server 2008, SQL Server 2008, and Visual Studio 2008.

Howard Dierking

MSDN Magazine Launch 2008

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

Debugging Tool: Build a Logging and Event Viewing Library to Help Debug Your .NET Framework-based Ap


Building a basic, reusable application framework can make development quicker and easier. This allows you to focus more on the problems at hand and less on the repetitive tasks involved in building any application. In this article, the author presents a framework that provides facilities to access the registry and an extensible framework for logging messages to a console window or the Event Viewer. This reusable framework can be included as a library in your projects, allowing you to display an enhanced, color-coded message log and dynamically change logging levels.

Daryn Kiely

MSDN Magazine May 2003

Debug: Detect and Plug GDI Leaks in Your Code with Two Powerful Tools for Windows XP


In a previous article, the author devised a simple method to detect Graphical Device Interface (GDI) objects that are not properly released by Win32-based applications on Windows 9x platforms. Because some newer versions of Windows require a slightly different approach to GDI leaks, the author has updated his techniques for those operating systems. He builds and explains two tools designed to detect and eradicate GDI leaks in applications running on Windows XP, Windows 2000, and Windows NT.

Christophe Nasarre

MSDN Magazine January 2003

Editor's Note: Elevating Test and Debug


Programming is fun. It's one of the world's great jobs, pure mental exercise with a golden payoff at the end. There's nothing like the feeling of accomplishment when that program you wrote is working, looks good, and is ready to ship.

MSDN Magazine January 2003



I'm following , and, trying to complete a working project which displays information from an XML file, however, VS 2008, is displaying the following errors, which I can't really understand:

  • Error 1 Invalid expression term ',' c:\inetpub\wwwroot\TestWebSite\Default.aspx 1 1 http://localhost/TestWebSite/
  • Error 2 ) expected c:\inetpub\wwwroot\TestWebSite\Default.aspx 1 1 http://localhost/TestWebSite/
  • Error 3 ; expected c:\inetpub\wwwroot\TestWebSite\Default.aspx 1 1 http://localhost/TestWebSite/
  • Error 4 Invalid expression term ')' c:\inetpub\wwwroot\TestWebSite\Default.aspx 1 1 http://localhost/TestWebSite

Source code here

error 500 in IIS, but work in debug



I have a website that is built in .Net framework 4. I have set up the site in IIS 7 on a win 7 and set the applicationpool to .Net 4. But the weird thing is that I cannot access the site if I go through IIS, I can only access the site if I debug the site from within VS 2010. 

Anyone got any ideas of where I should start to look?

how to debug assemblies in GAC?

hello all, i have custom dlls that are installed to GAC. Now i need to debug them using Vs.net 2008. How do i do the same ?   Regards durga  

Add Release-Only try-catch to CLR languages

Deploying a software, it's a common practice to encapsulate top-most function calls and/or event handlers with general try-catch blocks to deliver an error description to the user instead of just having him/her see the software exiting unexpectedly when unexpected exceptions occur. Unfortunately, during debugging it is most annoying to reach these log entries or message boxes instead of having Visual Studio halt where the exception occured. At the time of writing it is possible to designate particular exception types to halt the debugger when they are actually thrown. But it becomes a nuisance when there are many exception types to be marked this way. Plus, it becomes contra-productive if there is a scenario when expected exceptions of the marked types occur regularly and "Continue" has to be selected again and again in the debugger. Thus, I'd like to suggest to add a new, Microsoft specific, "try" keyword to all of the CLR languages (plus C++), perhaps something like "__try". This new kind of try should create a try-catch block only when compiling in Release mode. (This behaviour might apply to other configurations as well. I suppose the Configuration Settings dialog to provide an additional checkbox column to provide an option to select whether a particular configuration will create a try-catch block or not.)   See here for

How can I debug Windows Service using Visual Studio?

How can I debug Windows Service using Visual Studio? I wrote in Visual Studio 2008 Command Promt: installutil -i c:\projects\MyProject\bin\debug\win.exe I did Start to may service ,but every time that I want to debug service I get: Cannot start service from the command line or a debugger. A Windows Service must first be installed (using installutil.exe) and then started with the ServerExplorer, Windows Services Administrative tool or the NET START command.   What am I doing wrong?   Thanks, Raya        
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