1

I have built an API using ASP.NET Core 2.0 and I am looking to publish it to run and host it in IIS 8 (Windows Server 2012). I have found the following article that explains publishing it to IIS:

https://stackify.com/how-to-deploy-asp-net-core-to-iis/

But it requires the .NET Core Windows Server Hosting Bundle to be installed on the hosting machine, which I would prefer not to have to install on the hosting machines.

I am wondering if there is a way to publish the ASP.NET Core 2.0 application to a "pure" .NET 4.6.1 or 4.6.2 application such that I can run it in IIS without having to install additional .NET Core hosting dependencies.

  • Possible duplicate of [Convert .Net Core to .Net Framework](https://stackoverflow.com/questions/42623103/convert-net-core-to-net-framework) – Froopy Nov 17 '17 at 15:26

1 Answers1

2

Short answer: no. Your project itself must target the full framework. This in effect publishes it for the full framework, since the target affects the build. The point is that if you're thinking you can keep it targeting .NET Core, but somehow publish to .NET 4.6, no that cannot be done.

That said, I think you're going down a bad path. The only good reason to target .NET 4.6 is if you need something specific in the full framework that you can't get from .NET Core. Even if you intend to publish to IIS today, having the ability to publish to Nginx or another webserver, instead, or even to a Mac or Linux is worth its weight in gold. Just install the hosting bundle. What's the big deal, anyways?

Chris Pratt
  • 232,153
  • 36
  • 385
  • 444