title: VSTS 2010 SGEN : error : Could not load file or assembly (Exception from HRESULT: 0x80131515)
body: <p>I am experiencing a strange issue with VS2010. We use TFS to build our API dlls and we used to reference them in our projects usign a mapped network drive that was fully trusted. We have been working like that for at least two years and everything worked perfectly.</p>
  
  <p>Today, I converted a webapp to vs2010 and when I compile it in Release, it's giving me:</p>
  
  <blockquote>
    <p>SGEN : error : Could not load file or
    assembly 'file:///L:\Api\Release
    API_20100521.1\Release\CS.API.Exceptions.dll' or one of its dependencies. Operation
    is not supported. (Exception from
    HRESULT: 0x80131515)</p>
  </blockquote>
  
  <p>The strange thing is that it's working when it's under the Debug profile...</p>
  
  <p>I tried adding the</p>
  
  <pre><code>&lt;runtime&gt;
     &lt;loadFromRemoteSources enabled="true" /&gt;
  &lt;/runtime&gt;
  </code></pre>
  
  <p>into app.config and still no luck (See <a href="http://social.msdn.microsoft.com/Forums/en/msbuild/thread/d12f6301-85bf-4b9e-8e34-a06398a60df0" rel="noreferrer">http://social.msdn.microsoft.com/Forums/en/msbuild/thread/d12f6301-85bf-4b9e-8e34-a06398a60df0</a> and <a href="http://msdn.microsoft.com/en-us/library/dd409252(VS.100).aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/dd409252(VS.100).aspx</a>)</p>
  
  <p>I am pretty sure that this issue is from visual studio or msbuild, as our code won't run from a network share when in prod because all the referenced dll's are copied into the bin folder.</p>
  
  <p>If anyone has an solution (or just an idea for a search path) please let me know !</p>
  
  <p>Edit : It turns out that it was working in Debug mode because generation of serialisation assemblies was turned Off. As the title say, it's really a SGEN problem since it is this utility that says that the path is not trusted... </p>