lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <>
Subject [GitHub] [lucenenet] NightOwl888 opened a new pull request #467: Fix for code analyzer support on Visual Studio 2017 (fixes #394)
Date Thu, 15 Apr 2021 02:22:33 GMT

NightOwl888 opened a new pull request #467:

   Fixes #394.
   This downgrades our code analyzers from .NET Standard 2.0 to .NET Standard 1.3 to fix analyzer
loading issues in Visual Studio 2017 when referencing the `Lucene.Net` NuGet package.
   It also downgrades `Microsoft.CodeAnalysis.CSharp.Workspaces` and `Microsoft.CodeAnalysis.VisualBasic.Workspaces`
to 2.6.1 and adds direct dependencies on  `Microsoft.CodeAnalysis.CSharp` and `Microsoft.CodeAnalysis.VisualBasic`.
There is an [unofficial guide that describes how this versioning works](,
but this should add support for Visual Studio 15.6.1 and higher (previously it was 16.4.0
and higher).
   The patch was confirmed to work on Visual Studio 15.9.29 as well as Visual Studio 16.8.2
in both C# and Visual Basic.
   A `Version.props` file was also added so we can manually bump the binary version (version
revision only) whenever a change is made, which is [a requirement of Visual Studio](
to be able to reload an analyzer. This will prevent workarounds like
from being necessary, and helps to ensure we are verifying the correct copy when debugging.
   > NOTE: An attempt was made to detect the [Visual Studio version](
and disable installation of the analyzer using the `install.ps1` script, but it turns out
that [scripting support in NuGet packages is now deprecated](
and analyzers are now loaded by convention rather than with scripts. The scripts (which even
Microsoft's NuGet-packaged analyzers ship with) are only for backward compatibility support
with older VS versions and exit early to prevent double-installation from happening when convention-based
support exists.
   ### References
   - [Analyzer NuGet formats](
   - [How to create a Roslyn Analyzer project for C#](
(unofficial guide to mult-targeting Visual Studio versions)
   - [xunit.analyzers](
   - [StyleCop.Analyzers](
   - [Tutorial: Write your first analyzer and code fix](

This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:

View raw message