Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET Core 1.0 app won't run on .NET Core 1.1 system

I have a program that I'm trying to migrate over to .NET Standard/Core. The command line interface to the library is built with a target framework of netcoreapp1.0. I tried sending this to a tester (with a different OS) who only had .NET Core 1.1 installed. The program won't run, and gives the error:

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 understood it, each Core/Standard version was a strict superset of the prior one. As such, I expected a program that targeted 1.0 would still run on a system with 1.1, rather than having to multi-target every installation version.

More generally, how can I set things up so that I don't have to worry about a user coming along later with only a newer version of .NET Core being unable to run the program?

like image 798
dsmith Avatar asked Jan 06 '17 09:01

dsmith


People also ask

Does .NET Core support all the .NET framework app models?

. Net Core does not support desktop application development and it rather focuses on the web, windows mobile, and windows store. . Net Framework is used for the development of both desktop and web applications as well as it supports windows forms and WPF applications.

Can .NET Core application run on .NET framework?

In order to run ASP.NET Core Apps on the . NET Framework it needs to only reference . Core NuGet packages which contains only the . NET Standard 2.0 builds.

Can you mix .NET and .NET Core?

NET Standard support - it can't, as it doesn't even support async/await . You need to upgrade to . NET 4.6. 1, preferably .


2 Answers

You need to understand a few more concepts.

  1. A .NET Core app becomes self-contained if you use dotnet publish properly. Then on a target machine that has no .NET Core installed (or not the version it builds against) the app can run without problems. Based on your description, you probably forget to do so or you are not trying to publish this app.

  2. If your intention is just to move your .NET Core 1.0.1 based code to another machine and that machine only has 1.1.0 installed, well, you should be able to run dotnet-install script to install the required runtime,

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

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

like image 145
Lex Li Avatar answered Sep 28 '22 17:09

Lex Li


You're missing a global.json. Add one to your project so the application knows to boot with the 1.0.0 runtime and not 1.1.

like image 42
Kushan Avatar answered Sep 28 '22 16:09

Kushan