[英]How do I publish a .NET Core ASP.NET website that targets framework net461?
I need to publish a .NET Core ASP.NET Website for IIS that targets framework net461. 我需要发布一个针对IIS的.NET Core ASP.NET网站,其目标是框架net461。
I've tried: 我试过了:
dotnet publish --runtime active --output "C:\stuff\" --configuration Release
but this results in the project being output as a .exe (along with .dlls of the dotnet core dependencies like Microsoft.AspNetCore.Authorization.dll). 但这会导致项目以.exe格式输出(以及与诸如Microsoft.AspNetCore.Authorization.dll之类的dotnet核心依赖项的.dlls)。 I need to publish to IIS on a Windows Server 2008 R2. 我需要在Windows Server 2008 R2上发布到IIS。
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true,
"warningsAsErrors": true
},
"dependencies": {
"Microsoft.AspNetCore.Diagnostics.Elm": "0.1.0",
"Microsoft.AspNetCore.Authentication.Cookies": "1.0.0",
"Microsoft.AspNetCore.Authorization": "1.0.0",
"Microsoft.AspNetCore.Diagnostics": "1.0.0",
"Microsoft.AspNetCore.Hosting": "1.0.0",
"Microsoft.AspNetCore.Hosting.Abstractions": "1.0.0",
"Microsoft.AspNetCore.Http.Extensions": "1.0.0",
"Microsoft.AspNetCore.Localization": "1.0.0",
"Microsoft.AspNetCore.Mvc": "1.0.0",
"Microsoft.AspNetCore.Routing": "1.0.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
"Microsoft.AspNetCore.Session": "1.0.0",
"Microsoft.AspNetCore.StaticFiles": "1.0.0",
"Microsoft.Extensions.Caching.SqlServer": "1.0.0",
"Microsoft.Extensions.Logging.Console": "1.0.0",
"Microsoft.Extensions.Logging.Debug": "1.0.0",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0"
},
"frameworks": {
"net461": {}
},
Thanks for the help! 谢谢您的帮助!
It's perfectly fine to get an exe
output for IIS using .Net Core ( Self-contained application ). 使用.Net Core( 自包含应用程序 )为IIS获取exe
输出非常好。
I used following command to publish a test site: 我使用以下命令来发布测试站点:
dotnet publish --configuration Release --output "C:\\temp\\net461-site"
Pointed IIS to C:\\temp\\net461-site
(must have web.config
file), changed App Pool CLR version to No Managed Code
and the site works. 将IIS指向C:\\temp\\net461-site
(必须具有web.config
文件),将App Pool CLR版本更改为“ No Managed Code
并且该站点可以工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.