Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Side By Side Configuration error, Cannot resolve reference mscorlib

I have delphi application (hostproject.exe) and I want to consume .net com objects (NetSide.dll) with register free tech.

When application start, shows Side by Side Configuration error and sxtrace log :

Cannot resolve reference mscorlib, publicKeyToken="b77a5c561934e089", version="4.0.0.0".

hostproject.exe.manifest

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>    
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  <assemblyIdentity type="win32" name="client" version="1.0.0.0" />
  <dependency>
      <dependentAssembly>
          <assemblyIdentity type="win32" name="NetSide.sxs" version="1.0.0.0" processorArchitecture="msil"/>
      </dependentAssembly>
  </dependency>
</assembly>

NetSide.sxs.manifest

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  <assemblyIdentity type="win32" name="NetSide.sxs" version="1.0.0.0"  processorArchitecture="msil"/>
  <clrClass clsid="{E6C4A866-F58C-415E-9745-E0E7812B4386}" progid="NetSide.Class1" threadingModel="Both" name="NetSide.Class1" runtimeVersion="v4.0.30319"/>
  <file name="NetSide.dll" hashalg="SHA1"/>   
  <dependency>
    <dependentAssembly>
        <assemblyIdentity name="mscorlib" version="4.0.0.0"  processorArchitecture="x86"  publicKeyToken="b77a5c561934e089"/>
    </dependentAssembly>
  </dependency>
</assembly>

sxstrace log below:

=================
Begin Activation Context Generation.
Input Parameter:
    Flags = 0
    ProcessorArchitecture = Wow32
    CultureFallBacks = en-US;en
    ManifestPath = G:\Debug\HostProject.exe.Manifest
    AssemblyDirectory = G:\Debug\
    Application Config File = 
-----------------
    INFO: Parsing Manifest File G:\Debug\HostProject.exe.Manifest.
    INFO: Manifest Definition Identity is client11,type="win32",version="1.0.0.0".
    INFO: Reference: NetSide.sxs,processorArchitecture="msil",type="win32",version="1.0.0.0"
    INFO: Resolving reference NetSide.sxs,processorArchitecture="msil",type="win32",version="1.0.0.0".
    INFO: Resolving reference for ProcessorArchitecture msil.
        INFO: Resolving reference for culture Neutral.
            INFO: Applying Binding Policy.
                INFO: No binding policy redirect found.
            INFO: Begin assembly probing.
                INFO: Did not find the assembly in WinSxS.
                INFO: Attempt to probe manifest at G:\Debug\NetSide.sxs.DLL.
                INFO: Attempt to probe manifest at G:\Debug\NetSide.sxs.MANIFEST.
                INFO: Manifest found at G:\Debug\NetSide.sxs.MANIFEST.
            INFO: End assembly probing.
INFO: Resolving reference NetSide.sxs.mui,language="&#x2a;",processorArchitecture="msil",type="win32",version="1.0.0.0".
    INFO: Resolving reference for ProcessorArchitecture msil.
        INFO: Resolving reference for culture en-US.
            INFO: Applying Binding Policy.
                INFO: No binding policy redirect found.
            INFO: Begin assembly probing.
                INFO: Did not find the assembly in WinSxS.
                INFO: Did not find manifest for culture en-US.
            INFO: End assembly probing.
        INFO: Resolving reference for culture en.
            INFO: Applying Binding Policy.
                INFO: No binding policy redirect found.
        INFO: Begin assembly probing.
            INFO: Did not find the assembly in WinSxS.
            INFO: Did not find manifest for culture en.
        INFO: End assembly probing.
INFO: Parsing Manifest File G:\Debug\NetSide.sxs.MANIFEST.
    INFO: Manifest Definition Identity is NetSide.sxs,processorArchitecture="msil",type="win32",version="1.0.0.0".
        INFO: Reference: mscorlib,publicKeyToken="b77a5c561934e089",version="4.0.0.0"
        INFO: Resolving reference mscorlib,publicKeyToken="b77a5c561934e089",version="4.0.0.0".
        INFO: Resolving reference for ProcessorArchitecture mscorlib,publicKeyToken="b77a5c561934e089",version="4.0.0.0".
        INFO: Resolving reference for culture Neutral.
            INFO: Applying Binding Policy.
                INFO: No publisher policy found.
                INFO: No binding policy redirect found.
            INFO: Begin assembly probing.
                INFO: Did not find the assembly in WinSxS.
                INFO: Attempt to probe manifest at C:\Windows\assembly\GAC\mscorlib\4.0.0.0__b77a5c561934e089\mscorlib.DLL.
                INFO: Attempt to probe manifest at G:\Debug\mscorlib.DLL.
                INFO: Attempt to probe manifest at G:\Debug\mscorlib.MANIFEST.
                INFO: Attempt to probe manifest at G:\Debug\mscorlib\mscorlib.DLL.
                INFO: Attempt to probe manifest at G:\Debug\mscorlib\mscorlib.MANIFEST.
                INFO: Did not find manifest for culture Neutral.
            INFO: End assembly probing.
    ERROR: Cannot resolve reference mscorlib,publicKeyToken="b77a5c561934e089",version="4.0.0.0".
ERROR: Activation Context generation failed.
End Activation Context Generation.
like image 825
zgn Avatar asked Nov 21 '22 01:11

zgn


1 Answers

Remove your dependency on mscorlib from NetSide.sxs, and the processorArchitecture:

<!-- We depend on the assembly NetSide.sxs -->
<dependency>
    <dependentAssembly>
        <assemblyIdentity type="win32" 
            name="NetSide.sxs" 
            version="1.0.0.0" 
            language="*"/>
    </dependentAssembly>
</dependency>


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <assemblyIdentity type="win32" name="NetSide.sxs" version="1.0.0.0" />

  <clrClass clsid="{E6C4A866-F58C-415E-9745-E0E7812B4386}" progid="NetSide.Class1" threadingModel="Both" name="NetSide.Class1">
  </clrClass>

  <file name="NetSide.dll">
  </file>
</asmv1:assembly>
like image 168
Ian Boyd Avatar answered Apr 06 '23 00:04

Ian Boyd