I'm trying to run an MVC web project on my Mac with Visual Studio for Mac, but I get an error in the browser when it runs. The problem is that I don't fully understand, from the trace, what file causes the problem.
From what I could find on Google, the problem is that the application is built with different versions of the .NET framework (https://developer.xamarin.com/api/type/System.BadImageFormatException/ - bullet point 4) (?) - something that I do not know how to solve.
There is no error messages during completive, but at runtime I only get the error-view. The full text of the error view is below the line:
Application Exception
System.BadImageFormatException
Description: HTTP 500.Error processing request.
Details: Non-web exception.
Exception stack trace:
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
Version Information: 5.0.1.1 (2017-02/5077205 Thu May 18 16:11:37 EDT 2017); ASP.NET Version: 4.0.30319.42000
Powered by Mono