【发布时间】:2017-07-23 10:20:41
【问题描述】:
早上好,
我正在为 word 开发一个 C# 插件,第一版被编译为在 office word x64 下运行,但现在我必须在 x86 版本下运行它,在调试模式下加载项目时出现此错误:给定的程序集名称或代码库无效。 (来自 HRESULT 的异常:0x80131047) 异常文本:
System.IO.FileLoadException: Impossible de Charger le fichier ou l'assembly 'AppName, Version=1.0.0.0, Culture=neutral' ou une de ses dépendances。 Le nom ou le 代码库 de l'assembly donné n'est pas valide。 (HRESULT 异常:0x80131047) Nom de fichier: 'AppName, Version=1.0.0.0, Culture=neutral' à System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) à System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, 证据 assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark & stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) à System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) à System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean for Introspection) à System.Reflection.Assembly.Load(String assemblyString) à Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.ExecuteCustomization.CreateEntryPoint(String entryPointTypeName) à Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.ExecuteCustomization.Microsoft.VisualStudio.Tools.Office.Runtime.Interop.IExecuteCustomization2.LoadEntryPoints(IntPtr serviceProvider)
我已经检查了我的代码,没有引用...
我怀疑 GAC_32、GAC_64、GAC_MSIL 文件夹有问题
有什么想法吗?
【问题讨论】: