Note that there are some explanatory texts on larger screens.

plurals
  1. POSwitching to Release Build causes runtime error in Web Reference
    text
    copied!<p>I've got a problem with a SOAP Web Reference that was generated by Visual Studio 2005 (.NET framework is v2.0.50727.42) - it works fine under the Debug build configuration (and has for months) but now that I want to go live and have compiled using the Release configuration, it has stopped working.</p> <p>Exceptions are raised at runtime whenever I call a method on the Web Reference. The most common exception is:</p> <pre><code>System.InvalidOperationException: There was an error generating the XML document. ---&gt; System.ArgumentException: Item has already been added. Key in dictionary: 'MayriseWebServices.RefuseService.PremiseSummaryStructure' Key being added: 'MayriseWebServices.RefuseService.PremiseSummaryStructure' </code></pre> <p>The language for the project and the generated Web Reference is VB.NET rather than C#. As the generated Reference.vb code doesn't actually change, just the build type, I can't find anything there, and I obviously can't debug the Release build.</p> <p>I've noticed that the Release build splits off a *.XmlSerializers.dll assembly from the main build. Are there known problems with this?</p> <p>I'd rather not go live with the Debug build for obvious reasons. Maybe I should do some reading about CodeDOM, I have been meaning to!</p> <p>I should mention that I've found <a href="https://stackoverflow.com/questions/312312/what-are-some-reasons-a-release-build-would-run-differently-than-a-debug-build">a post with reasons why a Release build will run differently</a> but it seems to be focused on C++.</p> <p>Thanks for any help you can give.</p> <p><strong>UPDATE:</strong> The third suggestion to turn off the serialization assemblies has fixed the problem. I changed the "Generate serialization assemblies" setting from "Auto" to "Off" in the Advanced Compile Options, and my tests pass now. I wasn't aware of that setting.</p> <p>I'm not sure what the underlying problem with the serialization assemblies is. I'll provide an update if I get a chance to debug the Release assembly using your advice in the second suggestion.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload