我有一个在使用WPF用C#编写的Visual Studio 2013中运行良好的项目。这个项目有一些依赖:
在昨晚之前,该项目一直运行良好,运行并能够无问题地进行调试。但是,昨晚在决定处理该项目时,我打开并尝试编译然后调试。当应用程序试图通过调试器运行时,我收到:
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.
我根据其他问题尝试了一些基于Google的事情:
另外需要注意的是,编译后的二进制文件在Visual Studio外部运行良好。它只是拒绝在VS中调试。对我来说这没有意义,它会在没有错误的情况下在VS之外运行良好,但是在它内部抛出该错误而没有其他信息。
调试输出不包含任何有用的错误信息。
运行Build后编译 - >清洁给出:
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正在导致错误出现,因为我正在输入这个字段... :(
答案 0 :(得分:0)
感谢@yusefnejad,至于删除输出文件夹以及重置对依赖项的引用似乎已经解决了问题。不知道为什么这突然开始出现问题。没有其他任何改变,一切都在恢复。谢谢。 :)