Visual Studio for Mac中的BadImageFormatException

时间:2017-06-08 13:35:28

标签: c# macos asp.net-mvc-4 mono visual-studio-mac

我尝试使用Visual Studio for Mac在我的Mac上运行MVC Web项目,但是在运行时我在浏览器中收到错误。问题是我无法从跟踪中完全理解导致问题的文件。

从我在Google上可以找到的问题是,应用程序是使用不同版本的.NET框架构建的(https://developer.xamarin.com/api/type/System.BadImageFormatException/ - 项目符号4)(?) - 我不知道怎么做解决。

在补充期间没有错误消息,但在运行时我只得到错误视图。错误视图的全文位于以下行:

应用程序异常

System.BadImageFormatException

描述:HTTP 500.Error处理请求。

详情:非网络例外。

异常堆栈跟踪:

  at (wrapper managed-to-native) System.Reflection.Assembly:LoadFrom (string,bool)
  at System.Reflection.Assembly.LoadFrom (System.String assemblyFile) [0x00000] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System.Reflection/Assembly.cs:536 
  at System.Web.Compilation.AssemblyBuilder.ReferenceAssembly (System.Collections.Generic.Dictionary`2[TKey,TValue] moduleGuidCache, System.Collections.Generic.List`1[T] assemblies, System.String asmLocation) [0x00000] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/System.Web/System.Web.Compilation/AssemblyBuilder.cs:906 
  at System.Web.Compilation.AssemblyBuilder.ReferenceAssemblies (System.Collections.Generic.Dictionary`2[TKey,TValue] moduleGuidCache, System.Collections.Generic.List`1[T] assemblies, System.Collections.Specialized.StringCollection references) [0x0001c] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/System.Web/System.Web.Compilation/AssemblyBuilder.cs:901 
  at System.Web.Compilation.AssemblyBuilder.BuildAssembly (System.Web.VirtualPath virtualPath, System.CodeDom.Compiler.CompilerParameters options) [0x001f9] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/System.Web/System.Web.Compilation/AssemblyBuilder.cs:809 
  at System.Web.Compilation.AssemblyBuilder.BuildAssembly (System.CodeDom.Compiler.CompilerParameters options) [0x00000] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/System.Web/System.Web.Compilation/AssemblyBuilder.cs:736 
  at System.Web.Compilation.AppCodeAssembly.Build (System.String[] binAssemblies) [0x003be] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/System.Web/System.Web.Compilation/AppCodeCompiler.cs:268 
  at System.Web.Compilation.AppCodeCompiler.Compile () [0x000a1] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/System.Web/System.Web.Compilation/AppCodeCompiler.cs:666 
  at System.Web.HttpApplicationFactory.InitType (System.Web.HttpContext context) [0x00219] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/System.Web/System.Web/HttpApplicationFactory.cs:455 
  at System.Web.HttpApplicationFactory.GetApplication (System.Web.HttpContext context) [0x00018] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/System.Web/System.Web/HttpApplicationFactory.cs:472 
  at System.Web.HttpRuntime.Process (System.Web.HttpWorkerRequest req) [0x00052] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/System.Web/System.Web/HttpRuntime.cs:452 

版本信息:5.0.1.1(2017年5月18日星期四16:11:37) ASP.NET版本:4.0.30319.42000

由Mono提供支持

0 个答案:

没有答案