I just looked at the previous questions on the topic, but I have some weird results.
First of all, I followed and used the method suggested by Scott Hanselm in an old blog post: http://www.hanselman.com/blog/HowToProgrammaticallyDetectIfAnAssemblyIsCompiledInDebugOrReleaseMode.aspx p>
Thus, using IsJITOptimizerDisabled, I have to check if any particular DLL was compiled in release mode or debug mode.
It is strange that I just tried, created a simple application that checks this property and notifies the checked assembly in debug or in release mode. We checked the results and everything was in order with two dlls, which I already compiled in both modes.
Then I handed this simple application to a colleague who confirmed that the results are expected on his workstation, and in the Debug DLL “Debug”, “Release” is displayed (these two libraries are contained in the same zip folder as a simple application).
But when he tries to check these DLLs with this simple application on another server (via mstsc) for both DLLs, the simple application will show "Debug" (even if you open the DLL with ILDASM, everything seems fine and some specific methods are contained within the area "# if DEBUG ", missing from the Relase dll).
Now I'm going crazy, is there any reason for this? Am I too old to see what happens? Maybe reflection somehow depends on the environment? Is there a service pack that resolved a similarly known issue?
Greetings
Gianluca
grava source
share