1
votes

I am trying to deploy Asp.Net Core 2.1 application with target framework 4.6.1 on server. I am using dotnet publish command and copying the publish folder on the server where deployment is intended. Everything works fine on local machine. But when I am trying to run the application on the server , it is throwing the exception ".Net Framework 4.6.1 not installed, please install it.".

I thought .Net framework is not installed but when I checked installed software , I can see .Net 4.6.1 is installed. Not sure why the error is occurring.

Here is screenshot for the application error and installed software

enter image description here

2

2 Answers

2
votes

That error is odd, since you do indeed seem to have that version installed. However, I believe it may be a red herring. I haven't personally tried to run ASP.NET Core 2.1 on .NET Framework, but I suspect it may not work at the moment. The full framework support depends on .NET Standard compatibility which only goes up to .NET Core 2.0. (With .NET Standard 2.0). ASP.NET Core requires .NET Core 2.1. You can try targeting a later version of .NET Framework - something recent like 4.7.2. You may need to downgrade to ASP.NET Core 2.0, if you need to target .NET Framework.

1
votes

Your list only shows development packages to support targeting and developing for .NET Framework 4.6.1

See How to: Determine which .NET Framework versions are installed for ways to check the .NET Framework version on the machine.