模块应包含程序集清单
本文关键字:程序集清单 包含 模块 | 更新日期: 2023-09-27 18:07:41
我有一个在Visual Studio 2013中工作良好的项目,该项目是用c#使用WPF编写的。这个项目有几个依赖项:
- GalaSoft。MvvmLight工具包
- Newtonsoft。Json
- Xceed.Wpf.Toolkit
在昨晚之前,该项目一直工作良好,运行并能够无问题地进行调试。然而,昨晚当我决定在这个项目上工作时,我打开并尝试编译然后调试。当应用程序试图通过调试器运行时,我收到:
Error while trying to run project: Could not load file or assembly 'MyProjectName' or one of its dependencies. The module was expected to contain an assembly manifest.
我尝试了一些基于其他问题和谷歌的东西:
- 清洗溶液和重建没有帮助。
- 重命名项目没有帮助。
- 在依赖项和项目中没有名称冲突。
- 作为AnyCPU在调试器内工作,但我特别尝试使用x86
另一件需要注意的事情是编译后的二进制文件在Visual Studio之外运行良好。它只是拒绝在VS中调试,这对我来说没有意义,它可以在没有错误的情况下在VS外正常运行,但在没有额外信息的情况下抛出该错误。
调试输出不包含任何有用的错误信息。
运行Build -> Clean后编译:
1>------ Rebuild All started: Project: MyProjectName, Configuration: Debug x86 ------
1> MyProjectName -> <Path Stripped>'MyProjectName.exe
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
尝试调试x86版本给出:
'MyProjectName.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:'Windows'Microsoft.Net'assembly'GAC_64'mscorlib'v4.0_4.0.0.0__b77a5c561934e089'mscorlib.dll'
'MyProjectName.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:'Windows'assembly'GAC_MSIL'Microsoft.VisualStudio.HostingProcess.Utilities'12.0.0.0__b03f5f7f11d50a3a'Microsoft.VisualStudio.HostingProcess.Utilities.dll'
'MyProjectName.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:'Windows'Microsoft.Net'assembly'GAC_MSIL'System.Windows.Forms'v4.0_4.0.0.0__b77a5c561934e089'System.Windows.Forms.dll'
'MyProjectName.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:'Windows'Microsoft.Net'assembly'GAC_MSIL'System.Drawing'v4.0_4.0.0.0__b03f5f7f11d50a3a'System.Drawing.dll'
'MyProjectName.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:'Windows'Microsoft.Net'assembly'GAC_MSIL'System'v4.0_4.0.0.0__b77a5c561934e089'System.dll'
'MyProjectName.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:'Windows'assembly'GAC_MSIL'Microsoft.VisualStudio.HostingProcess.Utilities.Sync'12.0.0.0__b03f5f7f11d50a3a'Microsoft.VisualStudio.HostingProcess.Utilities.Sync.dll'
'MyProjectName.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:'Windows'assembly'GAC_MSIL'Microsoft.VisualStudio.Debugger.Runtime'12.0.0.0__b03f5f7f11d50a3a'Microsoft.VisualStudio.Debugger.Runtime.dll'
'MyProjectName.vshost.exe' (Managed (v4.0.30319)): Loaded '<Path Stripped>'MyProjectName.vshost.exe'
'MyProjectName.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:'Windows'Microsoft.Net'assembly'GAC_MSIL'System.Xml'v4.0_4.0.0.0__b77a5c561934e089'System.Xml.dll'
'MyProjectName.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:'Windows'Microsoft.Net'assembly'GAC_MSIL'Microsoft.CSharp'v4.0_4.0.0.0__b03f5f7f11d50a3a'Microsoft.CSharp.dll'
'MyProjectName.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:'Windows'Microsoft.Net'assembly'GAC_MSIL'System.Core'v4.0_4.0.0.0__b77a5c561934e089'System.Core.dll'
'MyProjectName.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:'Windows'Microsoft.Net'assembly'GAC_MSIL'System.Xaml'v4.0_4.0.0.0__b77a5c561934e089'System.Xaml.dll'
'MyProjectName.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:'Windows'Microsoft.Net'assembly'GAC_MSIL'System.Xml.Linq'v4.0_4.0.0.0__b77a5c561934e089'System.Xml.Linq.dll'
'MyProjectName.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:'Windows'Microsoft.Net'assembly'GAC_MSIL'WindowsBase'v4.0_4.0.0.0__31bf3856ad364e35'WindowsBase.dll'
'MyProjectName.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:'Windows'Microsoft.Net'assembly'GAC_64'PresentationCore'v4.0_4.0.0.0__31bf3856ad364e35'PresentationCore.dll'
'MyProjectName.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:'Windows'Microsoft.Net'assembly'GAC_MSIL'PresentationFramework'v4.0_4.0.0.0__31bf3856ad364e35'PresentationFramework.dll'
A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in Microsoft.VisualStudio.HostingProcess.Utilities.dll
The thread 'vshost.NotifyLoad' (0x15c8) has exited with code 0 (0x0).
The thread 'vshost.LoadReference' (0x29d0) has exited with code 0 (0x0).
'MyProjectName.vshost.exe' (Managed (v4.0.30319)): Loaded '<Path Stripped>'MyProjectName.exe', Symbols loaded.
'MyProjectName.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:'Windows'Microsoft.Net'assembly'GAC_MSIL'System.Configuration'v4.0_4.0.0.0__b03f5f7f11d50a3a'System.Configuration.dll'
'MyProjectName.vshost.exe' (Managed (v4.0.30319)): Loaded 'Microsoft.Practices.ServiceLocation'
'MyProjectName.vshost.exe' (Managed (v4.0.30319)): Loaded 'GalaSoft.MvvmLight.Extras'
'MyProjectName.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:'Windows'Microsoft.Net'assembly'GAC_MSIL'PresentationFramework-SystemXmlLinq'v4.0_4.0.0.0__b77a5c561934e089'PresentationFramework-SystemXmlLinq.dll'
'MyProjectName.vshost.exe' (Managed (v4.0.30319)): Loaded 'GalaSoft.MvvmLight'
A first chance exception of type 'System.IO.FileNotFoundException' occurred in System.dll
'MyProjectName.vshost.exe' (Managed (v4.0.30319)): Loaded 'System.Windows.Interactivity'
'MyProjectName.vshost.exe' (Managed (v4.0.30319)): Loaded 'Newtonsoft.Json'
'MyProjectName.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:'Windows'Microsoft.Net'assembly'GAC_MSIL'System.Numerics'v4.0_4.0.0.0__b77a5c561934e089'System.Numerics.dll'
'MyProjectName.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:'Windows'Microsoft.Net'assembly'GAC_MSIL'PresentationFramework.Aero'v4.0_4.0.0.0__31bf3856ad364e35'PresentationFramework.Aero.dll'
'MyProjectName.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:'Windows'Microsoft.Net'assembly'GAC_MSIL'System.Dynamic'v4.0_4.0.0.0__b03f5f7f11d50a3a'System.Dynamic.dll'
A first chance exception of type 'Microsoft.CSharp.RuntimeBinder.RuntimeBinderException' occurred in Microsoft.CSharp.dll
'MyProjectName.vshost.exe' (Managed (v4.0.30319)): Loaded 'Anonymously Hosted DynamicMethods Assembly'
'MyProjectName.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:'Windows'Microsoft.Net'assembly'GAC_MSIL'PresentationFramework-SystemXml'v4.0_4.0.0.0__b77a5c561934e089'PresentationFramework-SystemXml.dll'
A first chance exception of type 'Microsoft.CSharp.RuntimeBinder.RuntimeBinderException' occurred in Microsoft.CSharp.dll
A first chance exception of type 'Microsoft.CSharp.RuntimeBinder.RuntimeBinderException' occurred in Microsoft.CSharp.dll
A first chance exception of type 'Microsoft.CSharp.RuntimeBinder.RuntimeBinderException' occurred in Microsoft.CSharp.dll
A first chance exception of type 'Microsoft.CSharp.RuntimeBinder.RuntimeBinderException' occurred in Microsoft.CSharp.dll
'MyProjectName.vshost.exe' (Managed (v4.0.30319)): Loaded 'Xceed.Wpf.Toolkit'
A first chance exception of type 'Microsoft.CSharp.RuntimeBinder.RuntimeBinderException' occurred in Microsoft.CSharp.dll
A first chance exception of type 'Microsoft.CSharp.RuntimeBinder.RuntimeBinderException' occurred in Microsoft.CSharp.dll
A first chance exception of type 'Microsoft.CSharp.RuntimeBinder.RuntimeBinderException' occurred in Microsoft.CSharp.dll
'MyProjectName.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:'Windows'Microsoft.Net'assembly'GAC_64'System.Data'v4.0_4.0.0.0__b77a5c561934e089'System.Data.dll'
A first chance exception of type 'Microsoft.CSharp.RuntimeBinder.RuntimeBinderException' occurred in Microsoft.CSharp.dll
A first chance exception of type 'Microsoft.CSharp.RuntimeBinder.RuntimeBinderException' occurred in Microsoft.CSharp.dll
A first chance exception of type 'Microsoft.CSharp.RuntimeBinder.RuntimeBinderException' occurred in Microsoft.CSharp.dll
A first chance exception of type 'Microsoft.CSharp.RuntimeBinder.RuntimeBinderException' occurred in Microsoft.CSharp.dll
A first chance exception of type 'Microsoft.CSharp.RuntimeBinder.RuntimeBinderException' occurred in Microsoft.CSharp.dll
'MyProjectName.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:'Windows'Microsoft.Net'assembly'GAC_MSIL'UIAutomationTypes'v4.0_4.0.0.0__31bf3856ad364e35'UIAutomationTypes.dll'
'MyProjectName.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:'Windows'Microsoft.Net'assembly'GAC_MSIL'UIAutomationProvider'v4.0_4.0.0.0__31bf3856ad364e35'UIAutomationProvider.dll'
A first chance exception of type 'System.Net.WebException' occurred in System.dll
The thread 'vshost.RunParkingWindow' (0x31a4) has exited with code 0 (0x0).
The thread '<No Name>' (0x2884) has exited with code 0 (0x0).
The thread '<No Name>' (0x3590) has exited with code 0 (0x0).
The program '[12724] MyProjectName.vshost.exe: Managed (v4.0.30319)' has exited with code 0 (0x0).
The program '[12724] MyProjectName.vshost.exe: Program Trace' has exited with code 0 (0x0).
没有有用的堆栈信息,因为没有断点命中,因为它在我的应用程序启动之前就死了。所以我不确定是什么模块造成的。考虑到它在磁盘上从编译的东西运行得很好,我不认为这个问题存在于我的项目中,但可能在VS.内部。我没有在机器上安装/卸载任何东西,所以最近没有任何变化。我不知道为什么这事突然就发生了。
编辑
现在AnyCPU导致错误出现时,它只是字面上的工作,因为我正在输入这个…(
感谢@yusefnejad,删除输出文件夹以及重置依赖项的引用似乎已经解决了这个问题。不知道为什么突然就出问题了。其他的都没有改变,一切都恢复正常了。谢谢。:)