0

私のネイティブ プログラムは temp/A/prog.exe です。C++/CLI の temp/B/LoadAssem.dll で Assembly::Load() を使用して .Net アセンブリをロードしています。しかし、assem.dll は temp/C にある dynAssem.dll を参照します。私は次のように設定ファイルを書きました:

<configuration>  
   <runtime>  
      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">  
       <dependentAssembly>  
         <assemblyIdentity name="DynAssem"  
                           publicKeyToken="xxxxx"  
                           culture="neutral" />  
         <codeBase version="0.0.0.0" href="../C/DynAssem.dll"/>  
       </dependentAssembly>        
      </assemblyBinding>  
   </runtime>  
</configuration>

ただし、バインドは次のような Fusion 出力で失敗します。

=== Pre-bind state information ===
LOG: DisplayName = dynAssem
 (Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: dynAssem | Domain ID: 1
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///c:/temp/A/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = prog.exe
Calling assembly : XXX, Version=0.0.0.0, Culture=neutral, PublicKeyToken=XXX.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: c:\temp\A\prog.exe.Config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///c:/temp/A/dynAssem.DLL.
LOG: Attempting download of new URL file:///c:/temp/A/dynAssem/dynAssem.DLL.
LOG: Attempting download of new URL file:///c:/temp/A/dynAssem.EXE.
LOG: Attempting download of new URL file:///c:/temp/A/dynAssem/dynAssem.EXE.
LOG: All probing URLs attempted and failed.

このディレクトリ レイアウトが .NET の優先レイアウトではないことは理解しています。ただし、他の複数の言語をサポートする必要があるため、ディレクトリ構造とアセンブリの場所は変更できません。

4

1 に答える 1