当我调试我的Reaction.NET项目时,打开了两个终端.一个用于Reaction,一个用于.NET后端. 现在,当我将应用程序发布到一个文件夹时,我得到了一个wwwroot&;运行时文件夹、大量的dll和一个exe文件.
因此,我知道有一个终端不再出现了,因为Reaction应用程序现在只是一个文件夹,就像普通的html网站一样.
当我调试网站时,我得到:
info: Microsoft.Hosting.Lifetime[14]
Now listening on: https://localhost:7291
info: Microsoft.Hosting.Lifetime[14]
Now listening on: http://localhost:5026
info: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
Hosting environment: Development
info: Microsoft.Hosting.Lifetime[0]
Content root path: C:\Users\renek\source\ReactNet\ReactNet
info: Microsoft.AspNetCore.SpaProxy.SpaProxyLaunchManager[0]
No SPA development server running at https://localhost:44411 found.
info: Microsoft.AspNetCore.SpaProxy.SpaProxyMiddleware[0]
SPA proxy is not ready. Returning temporary landing page.
info: Microsoft.AspNetCore.SpaProxy.SpaProxyMiddleware[0]
SPA proxy is ready. Redirecting to https://localhost:44411.
info: Microsoft.AspNetCore.SpaProxy.SpaProxyLaunchManager[0]
SPA development server running at 'https://localhost:44411'
现在,当我将项目发布到我的VPS并运行exe时:
info: Microsoft.Hosting.Lifetime[14]
Now listening on: http://localhost:5000
info: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
Hosting environment: Production
info: Microsoft.Hosting.Lifetime[0]
Content root path: C:\inetpub
有人能解释一下我怎样才能得到相同的设置吗?
到目前为止,我try 过的是:
- Launchsettings.json将值从开发改为生产:
{
"profiles": {
"ReactNet": {
"commandName": "Project",
"launchBrowser": false, // True originally
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Production", // Development originally
"ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.SpaProxy"
},
"applicationUrl": "https://localhost:7291;http://localhost:5026"
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": false, // True originally
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Production", // Development originally
"ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.SpaProxy"
}
}
},
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:32385",
"sslPort": 44344
}
}
}
是的,我知道编辑启动设置只适用于开发.这是我真正出版的第一个项目,所以不要责怪我不知道怎么做.