Debugging extension in Visual Studio 2010 difficulties

2169
3
07-28-2011 11:37 AM
AndrewDavis
New Contributor
Hi all..

I have been moving code from my VS2008 ArcGIS 9.3.1 machine to the new VS 2010 ArcGIS 10.0 machine and have run into a problem.

One of my extensions has been moved across and had updates made to the References an now works just fine (Install and Debug) are working.

Another extenstion I am moving over (I didn't write it) has been moved over and updated to the VS 2010 (through the wizard that you get automatically) and it will not debug.

I get a message: "This code apears to have been optimized" and I cannot get the code to run in Debug mode (where I can step through it).

Any ideas?
0 Kudos
3 Replies
RichardWatson
Frequent Contributor
Has the assembly that you are trying to debug been built in Debug mode?

If so then check the project options for Debug and make sure the optimizations have been disabled (they are by default).
0 Kudos
AndrewDavis
New Contributor
Has the assembly that you are trying to debug been built in Debug mode?

If so then check the project options for Debug and make sure the optimizations have been disabled (they are by default).


Yes, the project has been Built/Rebuilt in Debug Mode.  The error I was getting ..is reading

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

Sooo..  "Enable Just My Code" in Tools/Options/Debugging/Options  (Visual Studio 2010) seemed to solve the problem.  You can read about it here...
Under

http://stackoverflow.com/questions/810203/the-following-module-was-built-either-with-optimizations-e...

Thanks..
0 Kudos
BhaskarSingh
New Contributor
1. You can delete all occurences (all projects) of the dll 
2. If its adin then try to delete your addin from and your Bin folder.     Then build the solution
3. Properties" -> "Build" -> "Advanced" -> Debug Info: Full
4. Unchecking "Just My Code" in Tools->Options->Debugging->General.

Hope this help to some else as well.
0 Kudos