问题
I've been trying to launch MVC5 (depends on .NET 4.5) under Mono for days now and with no success.
Configuration
- Clean install of latest Lubuntu
- No previous XSP/Mono
- Compile and install XSP/Mono from latest git sources
- Mono version: 3.2.7
Problem
When I run xsp4
on any folder it shows Version Information: 3.2.7 (master/1eef047 C nov 28 18:16:30 EET 2013); ASP.NET Version: 4.0.30319.17020
.
Latest Mono version supports .NET 4.5, does XSP?
If so, how can I make sure that it is using 4.5 instead of 4.0?
Even if I run XSP directly from Mono 4.5 folder (/usr/lib/mono/4.5/xsp4.exe
) it shows ASP.NET version is 4.0.
Also, XSP config line in /usr/bin/xsp4
looks like so. I'm very confused.
#!/bin/sh
exec /usr/bin/mono $MONO_OPTIONS "/usr/lib/mono/4.5/xsp4.exe" "$@"
回答1:
You can instruct mono to launch a particular runtime version with the --runtime
flag. In this case, it would be this way:
#!/bin/sh
exec /usr/bin/mono $MONO_OPTIONS --runtime=v4.5 "/usr/lib/mono/4.5/xsp4.exe" "$@"
However, as far as I understand, the 4.5 profile of .NET doesn't include changes in the runtime, but in the class libraries and compilers. So if the above doesn't work, it simply means that the version of the runtime that one needs to use to run a 4.5 application is simply the 4.0.30319 version.
The best way to understand this is to include this little image diagram grabbed from a Scott Hanselman's blog post:
回答2:
The only chance you can run MVC is to install mono 3.4.0. mono 3.2.7 won't work for MVC5
回答3:
I had followed this with mono 3.4.0 and successfully set up a very simple MVC5 under MonoDevelop,
http://curtis.schlak.com/2014/02/04/setup-asp-net-mvc-4-on-monodevelop-4.2.html
来源:https://stackoverflow.com/questions/20312489/can-xsp-run-asp-net-4-5