Note that there are some explanatory texts on larger screens.

plurals
  1. POPreventing .NET Assembly Version Redirection for System.Web.Services as Referenced by WSE
    primarykey
    data
    text
    <p>I've got an ASP.NET web site application targeting the <strong>.NET 4.0</strong> Framework and the application exposes some web services using WSE 3.0 (Microsoft.Web.Services3.dll) for security. I'm getting a <strong>SoapHeaderException: SOAP header Security was not understood</strong> error when I consume the service. I have a very similar setup working OK when the application is targeting .NET 2.0 and I've compared the config files without identifying any differences.</p> <p>Using <a href="http://www.red-gate.com/products/reflector/" rel="nofollow noreferrer">Reflector</a> I can see that <strong>Microsoft.Web.Services3.dll</strong> is referencing <strong>System.Web.Services, Version=2.0.0.0</strong> but when I check the assembly binding using <a href="http://msdn.microsoft.com/en-us/library/e74a18c4.aspx" rel="nofollow noreferrer">Fuslogvw.exe (Assembly Binding Log Viewer)</a> I see <em><strong>Version redirect found in framework config: 2.0.0.0 redirected to 4.0.0.0</strong></em>. I've checked the various machine level config files and there is no explicit reference to a redirect so I'm fairly sure the redirect is due to a Microsoft <a href="http://msdn.microsoft.com/en-us/library/dz32563a" rel="nofollow noreferrer">Publisher Policy</a> linked into the assemblies. I've tried to use the <a href="http://msdn.microsoft.com/en-us/library/cf9025zt" rel="nofollow noreferrer">publisherPolicy Element</a> to prevent this redirection using the config shown below but it does not seem to have any affect. I've also tried moving the publisherPolicy element outside the dependentAssembly element make it apply generally but that didn't help either.</p> <p>Any ideas what I'm doing wrong or alternative ways to force the assembly bind to the specific version of the assembly?</p> <pre><code>&lt;runtime&gt; &lt;assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"&gt; &lt;dependentAssembly&gt; &lt;assemblyIdentity name="System.Web.Services, Version=2.0.0.0" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/&gt; &lt;publisherPolicy apply="no" /&gt; &lt;/dependentAssembly&gt; &lt;/assemblyBinding&gt; &lt;/runtime&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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