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

NewtonSoft.JSon should not be added as "analyzer" #1694

Closed
jessehouwing opened this issue Oct 26, 2015 · 4 comments
Closed

NewtonSoft.JSon should not be added as "analyzer" #1694

jessehouwing opened this issue Oct 26, 2015 · 4 comments

Comments

@jessehouwing
Copy link

Recent upgrade has added NewtonSoft.JSon as an analyzer package, yet newtonsoft doesn't provide any analyzers.

 + <Analyzer Include="..\packages\StyleCop.Analyzers.1.0.0-beta013\analyzers\dotnet\cs\Newtonsoft.Json.dll" />
 + <Analyzer Include="..\packages\StyleCop.Analyzers.1.0.0-beta013\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />

I suppose that this reference should not have been added at all and that the assembly should live in a tools folder of the nuget package instead.

@sharwell
Copy link
Member

This reference is required because our analyzers in StyleCop.Analyzers.dll use it during analysis. If the assembly is not listed as an analyzer, it will not be located during the build and any analyzer which attempts to use it will throw an exception. Marking as a duplicate of #1624.

@jessehouwing
Copy link
Author

It would be better if you were to use the same version of NewtonSoft JSon that ships with Visual Studio... Plus, it now forces all analyzers that depend on this assembly to use at least your version. Wouldn't statically registering an AppDomain.AssemblyResolve event allow you to fetch the assembly either from the same directory the main assembly is stored, or a tools assembly folder?!

@jessehouwing
Copy link
Author

@sharwell
Copy link
Member

➡️ I reopened issue #1624 for further discussion.

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

2 participants