.NET Core 1.0 will not work on .NET Core 1.1

I have a program with which I am trying to switch to .NET Standard / Core. The command line interface for the library is built with the target structure netcoreapp1.0. I tried sending this to a tester (from a different OS) that only had .NET Core 1.1 installed. The program will not start and displays an error message:

The specified framework 'Microsoft.NETCore.App', version '1.0.1' was not found. - Check application dependencies and target a framework version installed at: /usr/share/dotnet/shared/Microsoft.NETCore.App - The following versions are installed: 1.1.0 - Alternatively, install the framework version '1.0.1'. 

Is this expected? As I understand it, each version of Core / Standard was a strict superset of the previous one. Thus, I expected that a program aimed at 1.0 would still work on a system with 1.1, instead of being multi-purpose for each version of the installation.

More generally, how can I configure things so that I don’t have to worry about the user arriving later when only a newer version of .NET Core will not be able to run the program?

+6
source share
2 answers

You need to understand a few more concepts.

  • The .NET Core application becomes self-sufficient if you use dotnet publish correctly. Then, on the target machine on which .NET Core is not installed (or there is no version with which it works), the application can work without problems. Based on your description, you probably forgot to do this or are not trying to publish this application.

  • If you intend to move the code based on .NET Core 1.0.1 to another computer, and only version 1.1.0 is installed on this computer, you should be able to run dotnet-install script to set the required execution time,

https://docs.microsoft.com/en-us/dotnet/articles/core/preview3/tools/dotnet-install-script

Since you are already using Visual Studio 2017 RC, you should know that .NET Core 1.0.x should now be 1.0.3. Support 1.0.0-1.0.2 has expired.

+2
source

You are missing global.json. Add one of them to your project so that the application can boot from 1.0.0, not 1.1.

+2
source

Source: https://habr.com/ru/post/1013821/


All Articles