I want to know about a thing that IS ASP.NET MVC 4 application can be run on .NET 4 server.
我想知道一个关于ASP的东西。NET MVC 4应用程序可以在。NET 4服务器上运行。
I am trying to deploy my MVC4 application and I am got the error that.
我正在尝试部署我的MVC4应用程序,我得到的错误是。
500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.内部服务器错误。您正在查找的资源有一个问题,不能显示它。
I target the .net 4 framework but I am still having this error. I am not sure what happen to server. I am trying to look on other post but I did not find any post who can clearify that MVC 4 can run on .net server.
我的目标是。net 4框架,但是我仍然有这个错误。我不知道服务器会发生什么。我正在尝试寻找其他的帖子,但是我没有找到任何一个帖子可以清除MVC 4在。net服务器上运行的问题。
3 个解决方案
#1
32
Yes. ASP.Net MVC 4 will run on ASP.Net 4 and ASP.Net 4.5. I am running a site on ASP.Net 4, and it is also confirmed in this blog post by Scott Gu. This assumes that you are not targeting any new 4.5 features in your application.
是的。ASP。Net MVC 4将在ASP上运行。净4和ASP。Net 4.5。我在ASP上运行一个网站。Net 4,这也被Scott Gu在这篇博客中证实了。这假定您没有针对应用程序中的任何新的4.5特性。
Be sure that you are copying the required MVC 4 .dll files in your bin folder if the server does not already have them installed. This post by Phil Haack explains how to bin deploy version 3. Hanselman has a similar article. You will need to check the version 4 release notes for the current .dlls required.
如果服务器尚未安装,请确保您正在将所需的MVC 4 .dll文件复制到bin文件夹中。Phil Haack的这篇文章解释了如何部署版本3。Hanselman也有类似的文章。您将需要检查版本4的发行说明,了解当前需要的.dll。
We may be able to provide a more specific answer if you can provide some additional details, and let us know what version of IIS and Visual Studio you are running.
如果您能提供一些额外的细节,并让我们知道您正在运行的IIS和Visual Studio的哪个版本,我们可能可以提供一个更具体的答案。
#2
5
- Right click your mvc4/webapi project ,choose the "Add Library Package Reference..." item, checked the "ASP.NET MVC" checkbox .
- 右键单击您的mvc4/webapi项目,选择“添加库包引用…”项,选中“ASP”。净MVC”复选框。
- Install DotNet Framework 4 Client Profile on your server.Because of the reference item "System.Net.Http" target framework is .net4 client profile.
- 在服务器上安装DotNet Framework 4客户端概要。因为引用项“System.Net”。Http“目标框架是。net4客户端配置文件。
- Publish your mvc4 project to your server
- 将您的mvc4项目发布到您的服务器。
- enjoy......:)_
- 享受……:)_
#3
2
Razor 2 is part of the next wave of the WebPages/MVC framework so it will require MVC4. There's nothing stopping you from using our Open-Source code to wedge Razor 2 in to MVC3, but it isn't a supported scenario.
Razor 2是下一波网页/MVC框架的一部分,因此需要MVC4。没有什么可以阻止您使用我们的开源代码将Razor 2嵌入到MVC3中,但是这不是一个受支持的场景。
Remember that MVC 4 works on .NET 4.0 and does NOT require .NET 4.5!
请记住,MVC 4可以在。net 4.0上工作,不需要。net 4.5!
ASP.net mvc程序员的博客
#1
32
Yes. ASP.Net MVC 4 will run on ASP.Net 4 and ASP.Net 4.5. I am running a site on ASP.Net 4, and it is also confirmed in this blog post by Scott Gu. This assumes that you are not targeting any new 4.5 features in your application.
是的。ASP。Net MVC 4将在ASP上运行。净4和ASP。Net 4.5。我在ASP上运行一个网站。Net 4,这也被Scott Gu在这篇博客中证实了。这假定您没有针对应用程序中的任何新的4.5特性。
Be sure that you are copying the required MVC 4 .dll files in your bin folder if the server does not already have them installed. This post by Phil Haack explains how to bin deploy version 3. Hanselman has a similar article. You will need to check the version 4 release notes for the current .dlls required.
如果服务器尚未安装,请确保您正在将所需的MVC 4 .dll文件复制到bin文件夹中。Phil Haack的这篇文章解释了如何部署版本3。Hanselman也有类似的文章。您将需要检查版本4的发行说明,了解当前需要的.dll。
We may be able to provide a more specific answer if you can provide some additional details, and let us know what version of IIS and Visual Studio you are running.
如果您能提供一些额外的细节,并让我们知道您正在运行的IIS和Visual Studio的哪个版本,我们可能可以提供一个更具体的答案。
#2
5
- Right click your mvc4/webapi project ,choose the "Add Library Package Reference..." item, checked the "ASP.NET MVC" checkbox .
- 右键单击您的mvc4/webapi项目,选择“添加库包引用…”项,选中“ASP”。净MVC”复选框。
- Install DotNet Framework 4 Client Profile on your server.Because of the reference item "System.Net.Http" target framework is .net4 client profile.
- 在服务器上安装DotNet Framework 4客户端概要。因为引用项“System.Net”。Http“目标框架是。net4客户端配置文件。
- Publish your mvc4 project to your server
- 将您的mvc4项目发布到您的服务器。
- enjoy......:)_
- 享受……:)_
#3
2
Razor 2 is part of the next wave of the WebPages/MVC framework so it will require MVC4. There's nothing stopping you from using our Open-Source code to wedge Razor 2 in to MVC3, but it isn't a supported scenario.
Razor 2是下一波网页/MVC框架的一部分,因此需要MVC4。没有什么可以阻止您使用我们的开源代码将Razor 2嵌入到MVC3中,但是这不是一个受支持的场景。
Remember that MVC 4 works on .NET 4.0 and does NOT require .NET 4.5!
请记住,MVC 4可以在。net 4.0上工作,不需要。net 4.5!
ASP.net mvc程序员的博客