roslyn: Errors when creating new analyzer project in VS2017 RC

Version Used: Visual Studio 2017 RC, v15.0.26014.0 with NuGet version of Microsoft.CodeAnalysis 2.0.0-rc2

Steps to Reproduce:

  1. File, New Project, Extensibility, Analyzer with Code Fix
  2. While creating the project, an error dialog is shown: A problem was encountered creating the sub project 'SomeAnalyzer1.Vsix'. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
  3. After dismiss with Ok, the project is created (without VSIX, only analyzer + test project)
  4. From the package manager console: Update-Package microsoft.codeanalysis.csharp -pre Update-Package : Could not install package 'Microsoft.CodeAnalysis.Common 2.0.0-rc2'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile7', 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.
  5. Project properties, Library, Targeting, select Target .NET Platform Standard The project's targets cannot be changed. The selected targets require the project to opt-into NuGet 3.0 support, however, Visual Studio cannot automatically do this for you. Please uninstall all NuGet packages and try again.

Expected Behavior: Project is created and packages can be updated without errors.

Actual Behavior: Various errors.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 1
  • Comments: 16 (15 by maintainers)

Most upvoted comments

Something else: when creating a new analyzer project, then trying to update packages to latest rc4 bits, updating the Test project succeeds, but the analyzer project fails with:

Could not install package 'Microsoft.CodeAnalysis.Common 2.0.0-rc4'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile7', 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.

@bkoelman change your .NET Framework version to be 4.6 instead of 4.5.2