VS Extension. Why am I getting "Module is optimized" despite compiling with debug?

109 views Asked by At

I've just cloned my VS Extension from github, and I'm editing with a clean install of VS 2017. When I click play, I get "You are debugging a release version..." Grub down in the output window, and the last line tells me my release build is optimized and symbol loading is skipped. Why might my debug build be considered optimized?

'devenv.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'c:\users\sby\appdata\local\microsoft\visualstudio\15.0_e271755fexp\extensions\simon boddy\queryfirst\1.0.2\QueryFirst.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Symbols for the module 'QueryFirst.dll' were not loaded.
1

There are 1 answers

0
AudioBubble On BEST ANSWER

Just because it says "debug" in the solution configuration dropdown on the toolbar,

configuration dropdown

doesn't mean that the project is configured correctly.

Right click on the project, select Properties, and on the build tab make sure the "optimize code" checkbox isn't checked.

Optimize code checkbox

Other things include making sure you're not referencing a solution project via directly referencing a dll in a /bin/release folder

Add Reference dialog

If everything is configured correctly and you still have this issue, close VS, nuke all bin/obj folders, restart and rebuild. After that point, if you still have the problem, create a new project and re-add your files to the new one.