包括在.NET 4.0框架asp.net MVC2? [英] Is asp.net MVC2 included in .net 4.0 framework?

查看:246
本文介绍了包括在.NET 4.0框架asp.net MVC2?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在服务器上安装了.NET 4。
现在我不知道我是否必须安装MVC 2的VS2008还​​是什么,因为我得到这个错误:

  

无法加载文件或程序集System.Web.Mvc,版本= 2.0.0.0,   文化=中性公钥= 31bf3856ad364e35或它的某一个依赖。   该系统找不到指定的文件。

解决方案

VS 2010自带的MVC 2,但它不是.NET框架适当的一部分。这意味着,如果你去下载.NET Framework 4可再发行,这将不包括MVC 2的运行时间。

但由于MVC是滨部署,这是好的。您的应用程序 - 如果部署到.NET 3.5 SP1或.NET 4的服务器 - 将刚才复制System.Web.Mvc.dll程序到/ bin文件夹,一切都会按预期运行。 MVC中的中等信任运行得很好。

要办一个服务器范围内安装您需要下载 AspNetMVC2_VS2008.exe 的<一个href="http://www.microsoft.com/downloads/details.aspx?FamilyID=C9BA1FE1-3BA8-439A-9E21-DEF90A8615A9&displaylang=en">here,重命名的.exe 的.zip 并在 mvcruntime 子文件夹,你会发现 AspNetMVC2.msi 文件。

然后,你必须运行:

  MSIEXEC /我AspNetMVC2.msi / L * V \ mvc.log MVC_SERVER_INSTALL =YES
 

I've installed .net 4 in the server.
Now I don't know if I must install the MVC 2 for VS2008 or what because I got this error:

Could not load file or assembly 'System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

解决方案

VS 2010 comes with MVC 2, but it's not a part of the .NET Framework proper. This means that if you go download the .NET Framework 4 redistributable, it will not include the MVC 2 runtime.

But since MVC is bin-deployable, this is fine. Your application - when deployed to a .NET 3.5 SP1 or .NET 4 server - will just copy System.Web.Mvc.dll to its /bin folder, and everything will run as expected. MVC runs just fine in Medium Trust.

To do a server wide install you need to download AspNetMVC2_VS2008.exe from here, rename the .exe to .zip and inside the mvcruntime sub-folder you'll find the AspNetMVC2.msi file.

Then you have to run:

msiexec /i AspNetMVC2.msi /l*v .\mvc.log MVC_SERVER_INSTALL="YES"

这篇关于包括在.NET 4.0框架asp.net MVC2?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆