English 中文(简体)
如何部署.NET 7 应用程序到 IIS 的子文件夹
原标题:How to deploy .NET 7 app to subfolder in IIS

我正试图将新建的.NET 7 Web API 放在子目录中的服务器上,以便我可以在 https://example.com/my_api 上访问它。

这是我第一次部署.NET 7。 我所有旧的 Webforms 应用程序都能够通过右键点击 IIS 中的文件夹来部署, 并选择“ 转到应用程序 ”, 然后确保我选择了正确的应用程序库 。

这似乎行不通。 我可以成功将它作为全新网站部署(这说明我安装了主机包正确,正在使用正确的应用程序库),但这需要我在https://example.com:12345 上访问,因为该网站不太友好。

当然,我也许可以设置某种 重置或其它域名, 将用户指向正确的端口, 但最好“转而应用”选项能如预期的那样运作, 这个应用程序可以和我的应用程序的其余部分并存。

需要我对.NET 7/.NET Core 做一些不同的事情吗?

谢谢!

问题回答

以下是404 错误消息的一些常见原因, 您可以检查它

  1. The requested file has been renamed.
  2. The requested file has been moved to another location and/or deleted.
  3. The requested file is temporarily unavailable due to maintenance, upgrades, or other unknown causes.
  4. The requested file does not exist.
  5. The appropriate Web service extension or MIME type is not enabled.
  6. A virtual directory is mapped to the root of a drive on another server.




相关问题
Session Management with Windows Authentication

In an ASP.NET web app, using Integrated Windows Authentication, is the session tied to the windows identity? In other words, if I login (using IWA) to the app, and the app stores some "stuff" in my ...

Using Elmah with Cassini

Does anyone know if I can use Elmah with Visual Studio build-in web server(aka Cassini)? I get it working easily on IIS, but using same configuration, it doesn t work with Cassini. When I requested ...

Setting hostname in IIS, include www?

I want to set the hostname for a website I m adding in IIS 7, however do I include the www in the hostname or not? because I want both www.mysite.com and mysite.com both to point to mysite on the ...

inetpub versus any other folder

I ve run websites out of inetpub, as well as from folders just residing on the C: drive. I wonder, are there any definitive advantages to running websites out of inetputwwwroot?

IIS 6.0 hangs when serving a web-service

I am having issues with one of our web-services. It works fine on my development machine (win XP) whether I host it as a separate application or using cassini from Visual studio. Once I deploy on the ...

热门标签