我最近安装了Visual Studio 2012。
然而,在安装之后,之前在Visual Studio 2010中正常工作的项目开始抛出并崩溃,出现以下错误:
'System.TypeInitializationException: MyType的类型初始化程序引发了异常。 ---> System.IO.FileNotFoundException: 找不到文件'MyAssembly.XmlSerializers'或它的一个依赖项。系统无法找到指定的文件。
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
我没有将项目升级到VS2012,我仍然像以前一样在VS2010中运行它。我没有对项目本身进行任何更改。唯一的变化是我在机器上安装了VS2012(和.NET 4.5)。
是什么导致了这个意外的问题?