Closed mwelsh1118 closed 4 years ago
Does the analyzer still work despite the warnings?
Looks like you may need a reference to the latest Microsoft.Net.Compilers package... I don't have the older version of VS so I can't test that.
No, with the warning the rules are not applied.
The Microsoft.Net.Compilers package works, but it's also deprecated. The replacement, Microsoft.Net.Compilers.Toolset, has the following warning: "Using it as a long term solution for providing newer compilers on older MSBuild installations is explicitly not supported. That can and will break on a regular basis." So we probably couldn't use that in production, unfortunately.
Version 1.2.0 reverts back to 3.4.0, so you can try that and see if it works
Actually I can't publish a new version yet - running into a problem where the analyzer can't load the new library project, I thought it might be because of ProjectReference and analyzers (which would be why attributes was using PackageReference) but that doesn't seem to be it.
This is available now in 1.2.4 to be tested
That version works. Thanks!
The new Microsoft.CodeAnalysis package that's referenced in 1.1 (Microsoft.CodeAnalysis 3.5) isn't included in Visual Studio 2019 Update 4, so compiling with that version of MSBuild produces this warning --
CSC : warning CS8032: An instance of analyzer Apex.Analyzers.Immutable.ApexAnalyzersImmutableAnalyzer cannot be created from C:\Users\markwelsh\source\repos\ApexExample\packages\Apex.Analyzers.Immutable.1.1.0\analyzers\dotnet\cs\Apex.Analyzers.Immutable.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified..
Is there a way to work around this? Or would it be possible to roll back to the version supported by 16.4? That's the most recent servicing baseline.