Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Roslyn for .Net 4.7.2 [duplicate]

Tags:

c#

roslyn

I am so confused.. I am trying to install a nuget package that has a dependency on .NetStandard v2.0, after reading this post about it, it made sense to me that I could run any library that is dependent on .NetStandard 2.0 with .Net 4.7.2. Unfortunately, while trying to install a nuget package, it fails, saying it is not compatible with .net 4.7.2.

I am mainly trying to add the new Roslyn libraries Microsft.CodeAnalysis and if you look at the dependencies it says it supports .Net 4.7.2, the issue seems to stem from another dll its dependent on Microsoft.CodeAnalysis.CSharp.Workspaces, as that says it only has a dependency on .NetStandard 2.0. (but really .Net 4.7.2 can run .NetStandard 2.0)

enter image description here

Does anyone know if this is possible or will I be needing to move to .net core framework to be able to support a project like this?

Really it should say it only has a dependency on .NetStandard 2.0 but be able to get installed onto a target framework with 4.7.2 or .Net Core

Edit:

Using Visual Studio 2015 and C#6.

Its a rehosted windows workflow designer application (working on c# compilation/intellisense for inputs to the designer)

like image 943
JohnChris Avatar asked Jun 18 '19 10:06

JohnChris


1 Answers

Thanks to @IanKemp for finding an answer that helped me, I will flag this post as a duplicate but I wanted to first post a step-by-step fix for future developers that may come across this.

So I downloaded the latest Nuget version (VS 2015 VSIX - latest v3.6.0) here

Then I tried to update to the latest Roslyn package via NuGet package mananger and got this error message:

enter image description here

The message points you to this link, that will download the .Net Standard Build Support extension: https://aka.ms/netstandard-build-support-netfx

I then tried to update to the latest Roslyn package and it all worked!!

Happy coding all.

like image 200
JohnChris Avatar answered Oct 31 '22 08:10

JohnChris