简体   繁体   中英

Publish ASP.NET MVC app on IIS

I have issues to deploy a simple application on IIS over a remote desktop. The application is a simple "Hello World" website using ASP.Net (not .core) with an MVC pattern, developed with Visual Studio 2017.

I use the "File System" way to publish my app and upload it to the server (Windows Server 2016) with IIS 10.

This is the parameters I used to publish my app on IIS : IIS配置

I had an HTTP ERROR 403.14 but following this topic ( HTTP Error 403.14 - Forbidden - The Web server is configured to not list the contents of this directory ) and adding the following code in my web.config

<system.webServer>
    <directoryBrowse enabled="true" />
</system.webServer>

I can see an improvement: I can see the directory, but the application won't start. 目录

If I use the following code in my web.config, I got an error 403.14 - Forbidden

<system.webServer>
    <defaultDocument>
       <files>
          <add value="insertion.aspx" />
       </files>
    </defaultDocument>
    <directoryBrowse enabled="false" />
</system.webServer>

What am I doing wrong ? I'm out of the idea. Thanks

You need to convert the site into an Application :

https://msdn.microsoft.com/en-us/library/bb763173(v=vs.100).aspx

The easier way to do this is to deploy directly from Visual Studio, which will configure it for you

Please publish your application to some folder c:\\pubfolder. Add a website in IIS and assign this folder c:\\pubfolder to the physical path.

Note: You may need to give a host name in case if port 80 is already used (sometimes default website already uses port 80) .Remember you may need to give an entry in hosts file for the host name given above, the location of host file is C:\\Windows\\System32\\drivers\\etc . And no need to enable directory browsing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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