InvalidCastException of a Activator.CreateInstance object during an installation procedure

浪尽此生 提交于 2019-12-02 03:49:36
Marcello Faga

I solved the problem following the link proposed at this post

stack overflow: appdomain-createinstancefromandunwrap-unable-to-cast-transparent-proxy

The link that gives us the solution code is

west-wind.com: Assembly Loading across appdomain

It is really a basic thing, i was falled in the case where an assembly is loaded by an external application (in my specific case: the wow64 installer application).

The application does not know where to find the assemblies that depend from the main assembly you are loading, so you have to write a custom assembly resolver for the current application domain (in my specific case: the wow64 installer application) in order to give the necessary loading information inside it.

Head to the west-winf link to get the code, it works perfectly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!