markneustadt.com

It works in DEBUG but not in RELEASE

I have come across a situation recently where I am coding in DEBUG mode and things are working perfectly.  When I go and try to get things running in RELEASE mode, I get an error.

Screen_Shot_2014-12-30_at_9_37_53_AM

 

The text of the error reads as such:

Error 2 Could not load file or assembly 'file://\\xxxxxxxxx.xxx.xxx\publisheddlls\Terso\JetstreamSDK\1.4.1\JetstreamSDK.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515) C:\tfs\Jetstream\OnSight\Dev\OnSight2010\

The big take away is the “File”… SGEN.  Basically, what this error is telling us is that the file it can’t load isn’t trusted.

We might be able to fix it if we rebuild and recompile the file.  If that’s not an option, there might be a way to sign the assembly so it becomes trusted.  Maybe.

Here’s one way to get the solution to build in RELEASE mode.  It might not be the *right* way, but it works.

Open the property pages for the project.

Screen_Shot_2014-12-30_at_9_42_48_AM

 

Next, go to the Build tab.  Toward the bottom of that page, there’s an entry for “Generate serialization assembly”.  The default setting for this is “Auto”.

Screen_Shot_2014-12-30_at_9_44_11_AM

 

Turn that to the “Off” setting.  Now, your solution will (probably) build in RELEASE mode.

 

Scroll To Top