简体   繁体   English

如何将ASP.NET MVC应用程序部署到IIS

[英]How to deploy an asp.net mvc application to IIS

I have build a web application based on asp.net mvc using Visual Studio 2015 and .NET framework 4.6.1. 我已经使用Visual Studio 2015和.NET Framework 4.6.1构建了基于asp.net mvc的Web应用程序。 The application have multiple projects. 该应用程序有多个项目。

The app is running successfully when I am running from Visual Studio but when I am publishing the app using Visual studio's "Publish" it is not working. 当我从Visual Studio运行时,该应用程序成功运行,但是当我使用Visual Studio的“发布”发布该应用程序时,该应用程序无法正常工作。

I have gone through tons of articles but no success, I have busting my 2nd day don't know exactly what the hell is wrong with IIS or what the hell I am missing. 我浏览了无数文章,但没有成功,我在第二天就不知道IIS到底出了什么问题,或者我错过了什么。

My Os is Windows 10 and Windows Server 2012 R2, Visual Studio version is 2015 and Application is built using .NET 4.5.6 我的操作系统是Windows 10和Windows Server 2012 R2,Visual Studio版本是2015,应用程序是使用.NET 4.5.6构建的

Appreciate if anyone can guide me to drill down the real issue. 感谢是否有人可以指导我深入探讨实际问题。 在此处输入图片说明

在此处输入图片说明

在此处输入图片说明

Thanks 谢谢

Create a new folder for eg website and create a subfolder bin where you'll be placing the dlls. 为网站创建一个新文件夹,并在其中放置dll的子文件夹。

Open IIS. 打开IIS。 Create a new website and point its physical path to the directory which you have created. 创建一个新网站,并将其物理路径指向您创建的目录。 Add a binding with a hostname eg mywebsite and assign port 80 to it.Make sure the ip is 127.0.0.1 添加一个带有主机名的绑定,例如mywebsite并为其分配端口80。确保IP为127.0.0.1

Edit your host file: %windir%\\System32\\drivers\\etc\\hosts add the following line: 127.0.0.1 mywebsite 编辑您的主机文件:%windir%\\ System32 \\ drivers \\ etc \\ hosts添加以下行:127.0.0.1 mywebsite

Open your browser and key in http://mywebsite 打开浏览器,然后输入http:// mywebsite

This should do the trick 这应该可以解决问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM