MissingMethodException when running application on different computer
- by Codesleuth
I have a problem where I compiled my application on Visual Studio 2010 while targetting the .NET Framework 3.5, deployed it to a client server, only to find it gives me the following error:
************** Exception Text **************
System.MissingMethodException: Method not found: 'Void
System.Xml.Xsl.XslCompiledTransform.Transform(
System.Xml.XPath.IXPathNavigable,
System.Xml.Xsl.XsltArgumentList,
System.Xml.XmlWriter,
System.Xml.XmlResolver)'.
************** Loaded Assemblies **************
[...]
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3082 (QFE.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
The method it says it's looking for is this: XslTransform.Transform Method (IXPathNavigable, XsltArgumentList, XmlWriter, XmlResolver) (Supported in: 4, 3.5, 3.0, 2.0, 1.1)
I've tried setting up a redirect to the .NET Framework 4.0 version of the same DLL using the assemblyBinding element like so:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Xml"
publicKeyToken="b77a5c561934e089"
culture="neutral" />
<bindingRedirect oldVersion="2.0.0.0"
newVersion="4.0.0.0"/>
<codeBase version="4.0.0.0"
href="file:///C:/WINDOWS/Microsoft.NET/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll" />
</dependentAssembly>
</assemblyBinding>
</runtime>
But now the application won't run, and puts this in the event log:
EventType clr20r3, P1
myapplication.exe, P2 3.85.12.27583,
P3 4be9757f, P4 system.configuration,
P5 2.0.0.0, P6 4889de74, P7 1a6, P8
136, P9
ioibmurhynrxkw0zxkyrvfn0boyyufow, P10
NIL.
So, in summary, (1) does anyone know why the application can't find the method listed, and (2) why doesn't it let me redirect to the .NET 4.0 version of System.Xml?
Any help is appreciated, I'm totally stuck!