简体   繁体   English

如何发布针对框架net461的.NET Core ASP.NET网站?

[英]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.

相关问题 ASP.NET Core应用程序未在IIS中启动(目标为net461) - ASP.NET Core application not starting in IIS (targets net461) 使用 ASP.NET Core Web 应用程序 (.NET Core) 并将 net461 设置为唯一框架与使用 (.NET Framework) 模板之间的区别 - Difference between using the ASP.NET Core Web Application (.NET Core) with net461 set as the only framework and using the (.NET Framework) template 用于编译的#if 语句中的 .NET 框架未识别 net461 - .NET framework in #if statement for compilation is not identifying net461 如何在同一个项目中定位netcoreapp2.0和net461 - How to target netcoreapp2.0 and net461 in the same project net461中的目标x86 - Target x86 in net461 .Net-程序集绑定不适用于net461中的Newtonsoft - .Net - Assembly Binding is not working for Newtonsoft in net461 如何基于.NET Core创建ASP.NET项目,而不是基于完整的框架? - How do I create a ASP.NET project based on the .NET Core, not on the full Framework? netstandard2.0(.net standard 2.0)类库不能引用net461(.net framework 4.6.1)类库 - netstandard2.0 (.net standard 2.0) class library cannot reference a net461 (.net framework 4.6.1) class library 如何在Docker容器中发布ASP.NET Core应用程序? - How do I publish an ASP.NET Core application in a Docker container? 来自netstandard 2.0的参考.net461程序集 - Reference .net461 assembly from netstandard 2.0
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM