Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Target a specific runtime version of .NET Core in VS2017

I successfully created and deployed a .NET Core App in Visual Studio 2015. It appears though that tooling and support for .NET Core in VS2015 is going away so I've decided to start fresh with VS2017. However the problem I'm running into is versioning. My hosting provider is running Plesk ~v12 and only supports a few of the run times, and definitely not the latest and greatest.

In VS2015 with the project.json I could target a specific run time version by modifying all the dependencies, however I can't see how to do this within Visual Studio 2017. My host has replied that they support "1.0.3" (Current version is 1.04 in the latest SDK) for .NET Core 1.0 apps, and "1.1.0 and 1.1.1" for .NET Core 1.1 apps. (Current version is 1.1.2 in the latest SDK)

When I deploy an application to my host, I receive the following error:

HTTP Error 502.5 - Process Failure

I believe this is caused because it is looking for runtime 1.0.4.

So, in a nutshell, how do I target the runtime version 1.0.3?

like image 900
Adam Vincent Avatar asked Feb 04 '23 06:02

Adam Vincent


1 Answers

To set a specific version of the .Net Core runtime, you can add the <RuntimeFrameworkVersion> element to your csproj. For example, to use .Net Core 1.0.3, use:

<TargetFramework>netcoreapp1.0</TargetFramework>
<RuntimeFrameworkVersion>1.0.3</RuntimeFrameworkVersion>
like image 125
svick Avatar answered Feb 23 '23 01:02

svick