我需要的Web服务器上安装MVC 3/4运行MVC应用程序 [英] Do I need to install MVC 3/4 on web server to run mvc application

查看:122
本文介绍了我需要的Web服务器上安装MVC 3/4运行MVC应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个MVC 4应用程序,并运行良好的,我安装了MVC 4扩展VS 2010。

I've a MVC 4 application and runs well on my DEV Machine where I installed MVC 4 extension for VS 2010.

在使用IIS 7部署到Web服务器,做我需要安装MVC 4或应该包括在我的项目DLL就足够了?

When deploying to the web server with IIS 7, do I need to install MVC 4 or should the dll included on my project is sufficient?

我问的原因是,我们需要提供要求的基础设施团队。

The reason I'm asking is we need to provide the requirement to infrastructure team.

感谢。

推荐答案

您可以运行无需在服务器上安装MVC MVC应用程序。有一种叫做部署依赖在Visual Studio。这将发布你的MVC的DLL在bin文件夹,当你发布。

You can run an MVC application without installing MVC on your server. There is something called deployable dependency in Visual studio. That will publish your MVC DLLs in your bin folder when you publish it.

MSDN 页面,

这将增加组件(DLL文件)到一个网站项目或Web应用程序
  项目。当你部署你的网站或应用程序,这些文件
  包括在部署项目。这是有用的,如果应用程序或
  你的项目依赖于技术尚未安装
  将承载您的Web项目的服务器。例如,你可以使用
  此功能部署ASP.NET MVC 3 Web应用程序服务器
  在没有安装ASP.NET MVC 3。

This will add assemblies (DLL files) to a Web site project or Web application project. When you deploy your Web site or application, the files are included in the deployed project. This is useful if applications or technologies that your project depends on are not already installed on the server that will host your Web project. For example, you can use this feature to deploy an ASP.NET MVC 3 Web application to a server that does not have ASP.NET MVC 3 installed.

右键单击项目并选择从上下文菜单中添加可部署依赖

Right Click on Project and Select Add Deployable Dependency from the context menu

选择你想要的所有DLL出版

Select what all DLLs you want to be published

单击确定后,您会看到一个新的文件夹,名为_bin_deployableAssemblies。您现在可以进行正常的出版程序,你将有dll文件在发布输出的bin文件夹。

After clicking OK, You will see a new folder called _bin_deployableAssemblies. You can do normal Publishing procedure now and you will have the dlls in the bin folder of the publish output.

检查这篇文章了解更多详情<一个href=\"http://haacked.com/archive/2011/05/25/bin-deploying-asp-net-mvc-3.aspx\">http://haacked.com/archive/2011/05/25/bin-deploying-asp-net-mvc-3.aspx

Check this post for more details http://haacked.com/archive/2011/05/25/bin-deploying-asp-net-mvc-3.aspx

您应该具有的Visual Studio 2010 SP1 。否则也不会在上下文菜单显示,当你在项目中右键单击公布。

You should have Visual Studio 2010 SP1. Otherwise it will not be shown in the context menu when you right click on the project to be published.

编辑:
作为MVC4的,所有必要的组件运行MVC应用程序会自动添加到bin目录,任何MVC4应用斌部署的(意味着你可以在一台服务器没有明确安装MVC运行)。出于这个原因,包括部署大会对话框已在Visual Studio 2012中删除

EDIT : As of MVC4, all necessary assemblies to run an MVC application are automatically added to the bin directory, and any MVC4 application is bin-deployable (means you can run it in a server without explicitly installing MVC) . For this reason, the Include Deployable Assemblies dialog has been removed from Visual Studio 2012

这篇关于我需要的Web服务器上安装MVC 3/4运行MVC应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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