如何部署ABP到IIS
How to deploy ABP to IIS
我有一个 ABP 模板。它是 Full .Net 框架中 Angular 的合并解决方案。我已经通过右键单击 Web.Host 项目然后发布创建了一个已发布的包。
这是我发布的文件夹的屏幕截图:
我还在我的本地 IIS 中添加了一个网站,并将其指向我发布的文件夹的 wwwroot 文件夹,如 localhost:8081
我已经将wwwroot/assets
文件夹中的appconfig.json
修改为:
{
"remoteServiceBaseUrl": "http://localhost:8081",
"appBaseUrl": "http://localhost:8081"
}
并且也将 appsettings.json
更改为
"App": {
"ServerRootAddress": "http://localhost:8081/",
"ClientRootAddress": "http://localhost:8081/",
"CorsOrigins": "http://localhost:8081,http://localhost:8081"
},
- 我是否需要在 IIS 中为主机添加另一个网站?如果是,我应该指向哪里?再次 wwwroot?所有 DLL 和 appsettings.json 都在 wwwroot 之上。我应该把它们都放在 wwwroot 中吗?
- 当我导航到
localhost:8081
时,我收到 "Resource not found" 提示符
- 我注意到 Published 文件夹中有一个
Web.Host.exe
文件。当将上述所有设置更改为 localhost:5000
并执行它时,它会在 localhost:5000
上运行主机并且在 localhost:5000/swagger
和 localhost:5000/app/
上都可以正常工作
- 是否需要IIS下的网站才能执行
Web.Host.exe
?如果是,我将如何添加这样的网站? .exe
文件的端口 5000 在哪里设置?
如果我将网站物理文件夹更改为已发布的文件夹(其中包含 wwwroot 文件夹),我会收到以下错误(似乎 web.config 文件有问题):
您需要 .NET Core 托管包.
Install the .NET Core Hosting Bundle on the hosting system. ...
a. Navigate to the .NET All Downloads page.
b. Select the latest non-preview .NET Core runtime from the list (.NET Core > Runtime > .NET Core Runtime x.y.z). ...
c. On the .NET Core runtime download page under Windows, select the Hosting Bundle Installer link to download the .NET Core Hosting Bundle.
...
Restart the system or execute net stop was /y followed by net start w3svc from a command prompt. Restarting IIS picks up a change to the system PATH made by the installer.
参考:https://docs.microsoft.com/en-us/aspnet/core/publishing/iis?tabs=aspnetcore2x
我有一个 ABP 模板。它是 Full .Net 框架中 Angular 的合并解决方案。我已经通过右键单击 Web.Host 项目然后发布创建了一个已发布的包。
这是我发布的文件夹的屏幕截图:
我还在我的本地 IIS 中添加了一个网站,并将其指向我发布的文件夹的 wwwroot 文件夹,如 localhost:8081
我已经将wwwroot/assets
文件夹中的appconfig.json
修改为:
{
"remoteServiceBaseUrl": "http://localhost:8081",
"appBaseUrl": "http://localhost:8081"
}
并且也将 appsettings.json
更改为
"App": {
"ServerRootAddress": "http://localhost:8081/",
"ClientRootAddress": "http://localhost:8081/",
"CorsOrigins": "http://localhost:8081,http://localhost:8081"
},
- 我是否需要在 IIS 中为主机添加另一个网站?如果是,我应该指向哪里?再次 wwwroot?所有 DLL 和 appsettings.json 都在 wwwroot 之上。我应该把它们都放在 wwwroot 中吗?
- 当我导航到
localhost:8081
时,我收到 "Resource not found" 提示符 - 我注意到 Published 文件夹中有一个
Web.Host.exe
文件。当将上述所有设置更改为localhost:5000
并执行它时,它会在localhost:5000
上运行主机并且在localhost:5000/swagger
和localhost:5000/app/
上都可以正常工作
- 是否需要IIS下的网站才能执行
Web.Host.exe
?如果是,我将如何添加这样的网站?.exe
文件的端口 5000 在哪里设置?
如果我将网站物理文件夹更改为已发布的文件夹(其中包含 wwwroot 文件夹),我会收到以下错误(似乎 web.config 文件有问题):
您需要 .NET Core 托管包.
Install the .NET Core Hosting Bundle on the hosting system. ...
a. Navigate to the .NET All Downloads page.
b. Select the latest non-preview .NET Core runtime from the list (.NET Core > Runtime > .NET Core Runtime x.y.z). ...
c. On the .NET Core runtime download page under Windows, select the Hosting Bundle Installer link to download the .NET Core Hosting Bundle....
Restart the system or execute net stop was /y followed by net start w3svc from a command prompt. Restarting IIS picks up a change to the system PATH made by the installer.
参考:https://docs.microsoft.com/en-us/aspnet/core/publishing/iis?tabs=aspnetcore2x