Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't install .NET Compiler Platform SDK #18954

Closed
ljw1004 opened this issue Apr 24, 2017 · 6 comments
Closed

Can't install .NET Compiler Platform SDK #18954

ljw1004 opened this issue Apr 24, 2017 · 6 comments

Comments

@ljw1004
Copy link
Contributor

ljw1004 commented Apr 24, 2017

Version Used: VS 15.1 (26403.7) Release, Community Edition

Steps to Reproduce:

  1. I did a google search that took me to this page https://marketplace.visualstudio.com/items?itemName=VisualStudioProductTeam.NETCompilerPlatformSDK

I installed the VSIX from it. Installation appeared to go okay. I searched for Analyzer in the File>New dialog, and the only C# result I got was "Download the .NET Compiler Platform SDK". So I guess installation hadn't worked.

  1. I tried clicking on that FileNew>C#>Extensibility>Download Compiler Platform SDK. It took me to a local page C:\Users\ljw1004\Documents\Visual Studio 2017\Projects\CSharpCompilerPlatformSDKDownload1\index.html with a fwlink to https://go.microsoft.com/fwlink/?LinkID=526901, which points to the exact same download page as I tried in Step1 (if you open it in an external window) or which downloads Roslyn_SDK.vsix directly (if you click on the link inside VS). Regardless, it says "This product is already installed to all applicable products".

  2. I tried going to Tools>Extensions and uninstalled the .NET Compiler Platform SDK. Then I launched the VS2017 installer, clicked on Modify, and turned on the "Visual Studio extension development" workload. This claims it lets you create code analyzers. (However, the "individual components" tab doesn't list any component that looks like it's at all related to .NET Compiler Platform SDK so I don't know if this really worked).

I then launched VS2017. Once again, the File>New dialog only had an option for "Download .NET Compiler Platform SDK". It let me install it okay (hence, the VS Installer checkbox apparently hadn't installed it!). But even after installing it, the File>New dialog continues to only have an option for "Download .NET Compiler Platform SDK".

Expected Behavior:

Please let me write an analyzer! I don't know how to get started!

Actual Behavior:

I can't even get started writing an analyzer.

@ljw1004
Copy link
Contributor Author

ljw1004 commented Apr 24, 2017

Edit: I next tried to create a File>New>C#>ClassLibrary (i.e. a standard desktop framework class library) and install a NuGet reference to Microsoft.CodeAnalysis. The NuGet installation failed because it said it couldn't find anything compatible with this target. I tried a few different target frameworks (40, 45, 452, 47) and got the same error on all of them.

4.5:



Attempting to gather dependency information for package 'Microsoft.CodeAnalysis.2.1.0' with respect to project 'ClassLibrary45', targeting '.NETFramework,Version=v4.5'
Gathering dependency information took 5.14 sec
Attempting to resolve dependencies for package 'Microsoft.CodeAnalysis.2.1.0' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'Microsoft.CodeAnalysis.2.1.0'
Resolved actions to install package 'Microsoft.CodeAnalysis.2.1.0'
Retrieving package 'Microsoft.CodeAnalysis 2.1.0' from 'nuget.org'.
Retrieving package 'Microsoft.CodeAnalysis.Common 2.1.0' from 'nuget.org'.
Retrieving package 'Microsoft.CodeAnalysis.CSharp 2.1.0' from 'nuget.org'.
Retrieving package 'Microsoft.CodeAnalysis.CSharp.Workspaces 2.1.0' from 'nuget.org'.
Retrieving package 'Microsoft.CodeAnalysis.VisualBasic 2.1.0' from 'nuget.org'.
Retrieving package 'Microsoft.CodeAnalysis.VisualBasic.Workspaces 2.1.0' from 'nuget.org'.
Retrieving package 'Microsoft.CodeAnalysis.Workspaces.Common 2.1.0' from 'nuget.org'.
Install failed. Rolling back...
Package 'Microsoft.CodeAnalysis.Common.2.1.0' does not exist in project 'ClassLibrary45'
Package 'Microsoft.CodeAnalysis.Common.2.1.0' does not exist in folder 'C:\Users\ljw1004\Source\Repos\private\Probabilistic\packages'
Executing nuget actions took 49.76 ms
Could not install package 'Microsoft.CodeAnalysis.Common 2.1.0'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.5', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
Time Elapsed: 00:00:05.1959760
========== Finished ==========

Next I tried to do File>New>.NET Standard Library. I guess by default this targets .NETStandard1.4? -- is a pain to find out with the "Properties" node absent from SolutionExplorer. Again NuGet failed saying it couldn't find anything compatible. I tried targeting .NETStandard 1.3 and got another error message:

Package Microsoft.Composition 1.0.27 is not compatible with netstandard1.3 (.NETStandard,Version=v1.3). Package Microsoft.Composition 1.0.27 supports: portable-net45+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile259)
One or more packages are incompatible with .NETStandard,Version=v1.3.
Package restore failed. Rolling back package changes for 'ProbabilisticAnalyzer'.

Oh boy this is a challenge! Eventually by blind luck I picked .NET Framework 4.6 and it seems to have worked.

@jmarolf
Copy link
Contributor

jmarolf commented Apr 24, 2017

Analyzers only work on .NET Framework 4.6 and newer
image
If you change this dropdown the template will show up

@ljw1004
Copy link
Contributor Author

ljw1004 commented Apr 24, 2017

Hmm... I guess I was mislead by a few things:

(1) Leaving the default .NET4.5 target, it shows an option "Download .NET SDK" which isn't relevant to my current setup nor does it guide me in the right direction

(2) The Installer workload seems to promise more than it actually delivers?

@jmarolf
Copy link
Contributor

jmarolf commented Apr 24, 2017

@ljw1004 I am not saying anything you've reported is not a bug, just trying to unblock you.

  1. I need to remove that "Download Roslyn SDK" project. It should just be a checkbox on the VS installer
  2. I need to move all the templates (on VS 2017) to be netstandard based.
  3. I need to update roslyn dependencies to no longer include Microsoft.Composition

With these changes I think most if not all of your pain points should be addressed

@ljw1004
Copy link
Contributor Author

ljw1004 commented Apr 24, 2017

Sure, understood (and appreciated), thanks!

@jmarolf
Copy link
Contributor

jmarolf commented Dec 15, 2017

Issue moved to dotnet/roslyn-sdk #70 via ZenHub

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants