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

Roslyn fails to load analyzer dependency assemblies #14866

Closed
alexperovich opened this issue Nov 1, 2016 · 4 comments
Closed

Roslyn fails to load analyzer dependency assemblies #14866

alexperovich opened this issue Nov 1, 2016 · 4 comments
Assignees
Labels
Area-Analyzers Bug Resolution-Duplicate The described behavior is tracked in another issue
Milestone

Comments

@alexperovich
Copy link
Member

alexperovich commented Nov 1, 2016

Version Used: 2.0.0-beta3

Steps to Reproduce:

  1. sync to dotnet/corefx master
  2. Replace BuildToolsVersion.txt with the following:

1.0.27-prerelease-01001-03

  1. run init-tools.cmd
  2. touch foo.cs
  3. run csc using Tools/dotnetcli/dotnet.exe Tools/csc.exe with the following commands:

/target:library
/out:foo.dll
/analyzer:Tools/analyzers/Desktop.CSharp.Analyzers.dll
foo.cs

Expected Behavior:
binary foo.dll is produced with no warnings

Actual Behavior:
The analyzer fails to load due to missing dependencies. The specific dependency is Desktop.Analyzers.dll

@srivatsn
Copy link
Contributor

You'll have to pass in all dependencies of an analyzer as input to the compiler. In this case there should be another /analyzer:Tools/analyzers/Desktop.Analyzers.dll

@alexperovich
Copy link
Member Author

The same thing happens with both assemblies passed into the compiler.

@srivatsn
Copy link
Contributor

@mavasani can you take a look at why it fails if the full set of dependencies?

@srivatsn srivatsn reopened this Nov 10, 2016
@srivatsn srivatsn added this to the 2.0 (RC.2) milestone Nov 10, 2016
@srivatsn srivatsn added the Bug label Nov 10, 2016
@mavasani
Copy link
Contributor

I am able to repro this issue with the above repro steps. Analyzers with dependencies fail to load with dotnetcore csc but work fine with netfx csc. This is the same issue as summarized in dotnet/roslyn-analyzers#1028 (comment). As summarized by @srivatsn in dotnet/roslyn-analyzers#1028 (comment), you will need .NetCore 1.1 and VS2017 RC compiler toolset to get the relevant fixes for this to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Analyzers Bug Resolution-Duplicate The described behavior is tracked in another issue
Projects
None yet
Development

No branches or pull requests

4 participants