我怎样才能在安装IIS7 asp.net的MVC 2? [英] How can I install asp.net mvc 2 on IIS7?

查看:138
本文介绍了我怎样才能在安装IIS7 asp.net的MVC 2?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开发了一个ASP.NET MVC 2的网站,现在需要将其部署到我的Web服务器。我已经克服了一些障碍已经,因为ASP.NET未安装等等,但现在我已经得到的地步,我能容纳普通内容的文件,如果我尝试打我的MVC的网址之一,我得到这个:

I have developed an ASP.NET MVC 2 website, and now need to deploy it to my web server. I've overcome some hurdles already, since ASP.NET was not installed etc. but I've now got to the point where I can serve up plain content files, and if I try to hit one of my MVC URLs I get this:

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

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.

不奇怪,那个,因为我还没有安装MVC2。问题是,我无法找到有关如何安装它的任何良好的信息!

Not surprising, that, as I've not installed MVC2. Problem is, I can't find any good information about how to install it!

借助 Microsoft下载中心列出3个文件,其中没有一个看好:

The Microsoft Download Center lists 3 files, none of which look promising:

ASP.NET-MVC-2-RTM-RELEASE-Notes.doc

ASP.NET-MVC-2-RTM-Release-Notes.doc

AspNetMVC2_VS2008.exe

AspNetMVC2_VS2008.exe

mvc2-ms-pl.zip

mvc2-ms-pl.zip

该网站并没有刻意去解释什么文件其实都是,但我认为的最后一个文件是源$ C ​​$ C。那是什么样子,反正。发行说明没有任何帮助,因为他们是所有关于安装在开发机器上,堪与EXE的名称明确指出,这是所有有关Visual Studio集成了。

The site doesn't bother to explain what the files actually are, but I assume that the last file is the source code. That's what it looks like, anyway. The release notes are no help whatsoever, since they're all about installing on your development machine, and indeed the name of the EXE makes it clear that that's all about Visual Studio integration too.

因此​​,我怎么居然部署的混账东西?

So how do I actually deploy the darn thing?

顾的博客链接到另一个选择是微软Web平台安装。现在,我不希望不仅仅是MVC2安装多了,我已经有IIS等设置,所以这似乎有点沉重。但它的所有学术,因为它拒绝我的服务器上运行,说:你的系统不支持或者类似的话。 (该服务器是Windows Server 2008标准SP2的,所以我真的不知道是什么问题)。

The other option linked to from Scott Gu's blog is the Microsoft Web Platform Installer. Now, I don't want to install more than just MVC2, and I already have IIS etc. set up, so this seems a bit heavy. But it's all academic, as it refuses to run on my server, saying "your system is not supported" or words to that effect. (The server is Windows Server 2008 Standard SP2, so I really don't know what it's problem is).

帮助!

[这是荒谬的,这应该是这么难! - 或者是不难的,但肯定是一个良好的保密]

[It's ridiculous that this should be so hard - or perhaps not hard at all, but certainly a well-kept secret!]

推荐答案

要部署一个MVC应用程序,你只需要确保您设置引用到复制到您的bin文件夹。具体地,这些DLL将需要在那里...

To deploy an MVC application, you just need to ensure that you set the references up to copy to your bin folder. Specifically, these DLLs will need to be in there...

System.ComponentModel.DataAnnotations.dll
System.Web.Abstractions.dll
System.Web.Mvc.dll
System.Web.Routing.dll

注意:复制到您的bin文件夹的引用

Note: Copying a reference to your bin folder.

在实践中,您可以通过以下步骤做到这一点:

In practice, you do this by following these steps:


  1. 在在参考右键单击
    参考一节你
    项目

  2. 选择属性

  3. 找到复制本地财产
    将其设置为true

请注意!

System.Web.Abstractions.dll
System.Web.Routing.dll

您只需要这两个如果.NET 3.5 SP1尚未安装 - 如果你没有SP1,则需要包括这两个DLL,这是SP1的一部分,通过MVC路由都需要

You only need these two if .NET 3.5 SP1 has not been installed - if you don't have SP1, you will need to include these two dlls, which are part of SP1 and are needed by MVC for routing.

这篇关于我怎样才能在安装IIS7 asp.net的MVC 2?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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