开发者

Probing .NET Assembly with Registration Free COM/.NET Interop

开发者 https://www.devze.com 2023-01-05 10:24 出处:网络
We have one assembly that is used by the VB6 executable via COM Interop. This assembly uses other .NET assembly (not available for COM). We have defined a .manifest for our VB6 application, so that we

We have one assembly that is used by the VB6 executable via COM Interop. This assembly uses other .NET assembly (not available for COM). We have defined a .manifest for our VB6 application, so that we can use the .NET assembly without registration. We also defined a .config for our VB6 application, with probing settings, to look in subdiretories ("bin") for assemblies.

If we put all .NET assemblies in the specified subdiretory ("bin"), our application starts successfully and we can work with it until the Interop-Assembly calls some code of the other assemblies. Then we get a runtime error '429' : ActiveX component can't create object.

When we drop the .config file and put all files in the same directory, the application works as expected.

Is it possible to use probing for .NET Assemblies that are used by a VB6 executable? Is there a way to setup up probing corretly so that the other assemblies are located successfully?

.config

<configuration>
   <runtime>
      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
         <probing privatePath="bin"/>
      </assemblyBinding>
   </runtime>
</configu开发者_开发技巧ration>


Well, looks like your .config file isn't working. That could happen when you try to debug the VB6 application from the VB6 IDE, the CLR will look in the wrong directory for the .config file. The ultimate tool you need to troubleshoot this is fuslogvw.exe, it shows you where the CLR looked for the assembly.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号