How can I force .NET to use a local copy of an assembly that's in the GAC

前端 未结 6 729
情话喂你
情话喂你 2020-11-29 19:42

I have a .NET assembly that (for reasons outside my control) must be in the GAC. However, the same assembly is used by another program, which has a its own copy of

6条回答
  •  清歌不尽
    2020-11-29 20:35

    Have you tried Assembly.LoadFromFile()? This is a manual thing to do, but should load your assembly into memory before it is needed. .NET will then use the one in memory instead of hunting for it.

    Another way would be if the local assembly was unsigned, you could differentiate it that way.

    Rob

提交回复
热议问题