I am having some trouble deploying my MVC3 application to my localhost. I am looking for details to build and deploy a ASP MVC 3 application to my local system. I've tried to deploy this, but have run into problem after problem. Instead of tracking each problem down separately (and I may have to do this anyways) I would like to create a one stop guide for myself and others that see this post.
我在将我的MVC3应用程序部署到localhost时遇到了一些麻烦。我正在寻找构建和部署ASP MVC 3应用程序到我的本地系统的细节。我试图部署这个,但问题后遇到了问题。而不是单独跟踪每个问题(我可能不得不这样做)我想为自己和其他人看到这篇文章创建一站式指南。
I'm looking for steps including libraries to install (ASP MVC3, IIS, etc) on a Win7 SP1 machine with VS2010 installed. Also how do I set up IIS, and how do I publish? The goal will be to deploy this web app to another Win7 machine in the house, but localhost will be the first step. In addition, it would be helpful to know whatever steps are necessary to make the website accessible from another machine on the same network.
我正在寻找安装VS2010的Win7 SP1机器上安装库(ASP MVC3,IIS等)的步骤。另外我如何设置IIS,以及如何发布?目标是将这个Web应用程序部署到家中的另一台Win7机器上,但localhost将是第一步。此外,了解使网站可以从同一网络上的另一台计算机访问所需的任何步骤将会很有帮助。
Here is what I have done so far:
这是我到目前为止所做的:
- Created an ASP MVC 3 application with VS2010
- 使用VS2010创建了一个ASP MVC 3应用程序
- Built and Run
- 建造和运行
- Installed IIS
- 安装IIS
-
In IIS - "Added Application" on "Default Web Site" with the Alias: "Hello"
在IIS中 - 使用别名在“默认网站”上添加“应用程序”:“Hello”
4a. "Hello" runs on the DefaultAppPool, .Net 4.0; Integrated Pipeline
4A。 “Hello”在DefaultAppPool上运行,.Net 4.0;综合管道
4b. "Hello" has the physical path C:\inetpub\Hello
4B。 “Hello”具有物理路径C:\ inetpub \ Hello
- In VS2010 - right clicked the project and selected "Publish", using FTP
- 在VS2010中 - 右键单击项目并使用FTP选择“发布”
- web browser: navigate to "localhost/Hello"
- Web浏览器:导航到“localhost / Hello”
500.19 - Internal Server error:
500.19 - 内部服务器错误:
Config Error: This configuration section cannot be used at this path. This happens when
the section is locked at a parent level. Locking is either by default
(overrideModeDefault="Deny"), or set explicitly by a location tag with
overrideMode="Deny" or the legacy allowOverride="false"
Config File:
配置文件:
\\?\C:\inetpub\wwwroot\web.config
Requested URL:
请求的网址:
http://localhost:80/Hello
Physical Path:
物理路径:
C:\inetpub\Hello
Config Source:
配置来源:
68: <validation validateIntegratedModeConfiguration="false" />
68:
69: <modules runAllManagedModulesForAllRequests="true" />
69:
70: </system.webServer>
70:
3 个解决方案
#1
8
Download and install ASP MVC 3
下载并安装ASP MVC 3
Create an MVC3 Hello World App in Visual Studio
在Visual Studio中创建MVC3 Hello World应用程序
Install IIS from the “Windows Features” / “Turn Windows features on or off” in Windows.
在Windows中从“Windows功能”/“打开或关闭Windows功能”安装IIS。
Next, you need to configure a website in IIS. I created one on port 81. Open IIS Manager, and “Add a Website” to the “Sites” node.
接下来,您需要在IIS中配置网站。我在端口81上创建了一个。打开IIS管理器,并将“添加网站”添加到“站点”节点。
For this website, I created this on D:\WebSite, and configured it to run on DefaultAppPool, configured for .NET 4.0, on port 81.
对于这个网站,我在D:\ WebSite上创建了它,并将其配置为在端口81上在.NET 4.0上配置的DefaultAppPool上运行。
Most of the time, IIS is installed after installing the .NET Framework, so you’ll need to run some commands to register ASP.NET on IIS.
大多数情况下,IIS是在安装.NET Framework之后安装的,因此您需要运行一些命令在IIS上注册ASP.NET。
start cmd.exe as an administrator and run aspnet_regiis -i in C:\Windows\Microsoft.NET\Framework64\v4.0.30319
以管理员身份启动cmd.exe并在C:\ Windows \ Microsoft.NET \ Framework64 \ v4.0.30319中运行aspnet_regiis -i
Initially, I had some trouble publishing the project to the destination but for whatever reason, Publish method: “FTP” to Target Location “D:\WebSite” seems to work quite well and publish only the minimum required files.
最初,我在将项目发布到目的地时遇到了一些麻烦,但无论出于何种原因,发布方法:“FTP”到目标位置“D:\ WebSite”似乎运行良好,只发布所需的最少文件。
#2
0
traditionally you could only deploy to your server using ftp. Though it doesn't make a lot of sense to ftp to a server which runs locally. However Microsoft recently introduce the Web Deployment Tool which works really well. Once you install them then you have the option of creating a deployable package
传统上,您只能使用ftp部署到您的服务器。虽然ftp到本地运行的服务器没有多大意义。但是,微软最近推出了可以很好地运行的Web部署工具。安装后,您可以选择创建可部署的软件包
#3
0
In Publish dialog, choose option Filesystem instead of FTP, and give it path you have set in IIS
在“发布”对话框中,选择“文件系统”而不是“FTP”,并为其指定在IIS中设置的路径
#1
8
Download and install ASP MVC 3
下载并安装ASP MVC 3
Create an MVC3 Hello World App in Visual Studio
在Visual Studio中创建MVC3 Hello World应用程序
Install IIS from the “Windows Features” / “Turn Windows features on or off” in Windows.
在Windows中从“Windows功能”/“打开或关闭Windows功能”安装IIS。
Next, you need to configure a website in IIS. I created one on port 81. Open IIS Manager, and “Add a Website” to the “Sites” node.
接下来,您需要在IIS中配置网站。我在端口81上创建了一个。打开IIS管理器,并将“添加网站”添加到“站点”节点。
For this website, I created this on D:\WebSite, and configured it to run on DefaultAppPool, configured for .NET 4.0, on port 81.
对于这个网站,我在D:\ WebSite上创建了它,并将其配置为在端口81上在.NET 4.0上配置的DefaultAppPool上运行。
Most of the time, IIS is installed after installing the .NET Framework, so you’ll need to run some commands to register ASP.NET on IIS.
大多数情况下,IIS是在安装.NET Framework之后安装的,因此您需要运行一些命令在IIS上注册ASP.NET。
start cmd.exe as an administrator and run aspnet_regiis -i in C:\Windows\Microsoft.NET\Framework64\v4.0.30319
以管理员身份启动cmd.exe并在C:\ Windows \ Microsoft.NET \ Framework64 \ v4.0.30319中运行aspnet_regiis -i
Initially, I had some trouble publishing the project to the destination but for whatever reason, Publish method: “FTP” to Target Location “D:\WebSite” seems to work quite well and publish only the minimum required files.
最初,我在将项目发布到目的地时遇到了一些麻烦,但无论出于何种原因,发布方法:“FTP”到目标位置“D:\ WebSite”似乎运行良好,只发布所需的最少文件。
#2
0
traditionally you could only deploy to your server using ftp. Though it doesn't make a lot of sense to ftp to a server which runs locally. However Microsoft recently introduce the Web Deployment Tool which works really well. Once you install them then you have the option of creating a deployable package
传统上,您只能使用ftp部署到您的服务器。虽然ftp到本地运行的服务器没有多大意义。但是,微软最近推出了可以很好地运行的Web部署工具。安装后,您可以选择创建可部署的软件包
#3
0
In Publish dialog, choose option Filesystem instead of FTP, and give it path you have set in IIS
在“发布”对话框中,选择“文件系统”而不是“FTP”,并为其指定在IIS中设置的路径