Home Articles My Account Messages Tools Join
Tech Blog, ASP.Net, VB.Net, C#.Net, Programming Help, Help Guide
StellarPC.com | Fixing Debug Error - 'The following module was built either with optimization enabled or without deb (Visual Studio)
Fixing Debug Error - 'The following module was built either with optimization enabled or without deb (Visual Studio)
Written by: Evan Cummings

Fixing Debug Error - 'The following module was built either with optimization enabled or without deb

When attempting to step through an application, you may receive an error message such as -


The following module was built with optimizations enabled or without debug information:

{Path to DLL}

To debug this module, change its project build configuration to Debug mode. To supress this message, disable the 'Warn if no user code on launch' debugger option.


At this point you may confirm the prompt and your application will continue to load as normal. It will, however, ignore any debugging instructions you have givin it, such as breakpoints. This is the result of the way the code was built, and there are two approaches to solve it:

1 - Ignore the message...

To simply make this prompt no longer appear, you can do the following:

Go to Tools --> Options --> Debugging --> General

At this point, unselect 'Enable Just My Code (Managed Only)'.

This should now rid you of the prompt.

2 - Allow Debugging...

Due to the nature in which one of the assemblies has been built in your application, you will need to change a few settings to allow the code to be handled by the Visual Studio Debugger.

Right click on any project in question from the solution explorer and select 'Properties'. This will open up the project properties panel giving us access to a great many options for our projects. Navigate to the 'Complile' Tab (or 'Build' if your in a C# environment) and select 'Advanced Compile Options...' from the bottom of the screen. This presents us with a prompt that has two key areas of interest:

1) Optimizations - uncheck 'Enable Optimizations'
2) Generate debug info - Ensure that the option is set to 'Full'

A final issue to consider before proceeding is that the project is set to be built in Debug mode (as opposed to Release Mode). Release mode strips our code of the ability to do any fine detail debugging as its goal is to slim down and secure our assemblies for a production environment. While still on the Complile/Build tab ensure that 'Configuration' is set to Active(Debug) (or, alternatively, in the toolbar ensure it is set to Debug). When this option is properly set, the project will be built with full debugging capabilities included and accessible.



Content - Visual Studio 2008, Visual Studio 2005, VB.NET, C#.NET, Debugging
New Post Next 50 | Previous 50
Post# Subject: Posted By: Time:
New Post Next 50| Previous 50