Martin Hollingsworth
Martin Hollingsworth

Reputation: 7329

Preventing .NET Assembly Version Redirection for System.Web.Services as Referenced by WSE

I've got an ASP.NET web site application targeting the .NET 4.0 Framework and the application exposes some web services using WSE 3.0 (Microsoft.Web.Services3.dll) for security. I'm getting a SoapHeaderException: SOAP header Security was not understood 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.

Using Reflector I can see that Microsoft.Web.Services3.dll is referencing System.Web.Services, Version=2.0.0.0 but when I check the assembly binding using Fuslogvw.exe (Assembly Binding Log Viewer) I see Version redirect found in framework config: 2.0.0.0 redirected to 4.0.0.0. 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 Publisher Policy linked into the assemblies. I've tried to use the publisherPolicy Element 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.

Any ideas what I'm doing wrong or alternative ways to force the assembly bind to the specific version of the assembly?

<runtime>
  <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
      <assemblyIdentity name="System.Web.Services, Version=2.0.0.0" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
      <publisherPolicy apply="no" />
    </dependentAssembly>
  </assemblyBinding>
</runtime>

Upvotes: 3

Views: 1032

Answers (0)

Related Questions