我有一台运行 Windows Server 2008 R2 的服务器。它目前在 IIS 中运行多个 ASP.NET 4.5.2 应用程序。
我有一个新的 ASP.Net Core 应用程序,我想将其部署到同一台服务器上的 IIS。
- 这可能吗?
- 我需要做什么才能让它发挥作用?
在我的 .Net Core 应用程序中,我的主要方法中包含以下内容:
public static void Main(string[] args)
{
var host = new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration()
.UseStartup<Startup>()
.UseStructureMap()
.Build();
host.Run();
}
我的 project.json 中还有以下内容
"Microsoft.NETCore.App": {
"version": "1.1.0"
},
"runtimes": {
"win7-x64": {}
}
我想确保我的 .Net Core 和遗留的 .Net Framework 应用程序不会相互冲突。
最佳答案
我能够按照本教程进行操作:https://learn.microsoft.com/en-us/aspnet/core/publishing/iis
关键是,当我在服务器上安装 .NET Core Windows Server 托管 bundle 时,我没有安装 .Net Core 运行时,因为我的 .Net Core 应用程序是独立的。我通过从命令行安装 Hosting Bundle 并使用以下命令来完成此操作
DotNetCore.1.0.3_1.1.0-WindowsHosting.exe OPT_INSTALL_LTS_REDIST=0 OPT_INSTALL_FTS_REDIST=0
关于c# - Windows Server 2008 R2 共同托管遗留 .Net 应用程序与 .Net Core 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42542711/