lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <>
Subject [GitHub] [lucenenet] NightOwl888 commented on issue #394: Lucene.Net Nugget (4.8.0-beta00013) does not compile under Visual 2017 - Lucene.Net.CodeAnalysis.Lucene1000_TokenStreamOrItsIncrementTokenMethodMustBeSealedCSAnalyzer
Date Tue, 24 Nov 2020 18:39:36 GMT

NightOwl888 commented on issue #394:

   Thanks for the report.
   I suspect that VS2017 requires .NET Framework < 4.6.1 or .NET Standard 1.x in order
for the Analyzers to function. Unfortunately, there doesn't seem to be any documentation on
how to create a multi-targeted VS analyzer package, so the simplest course of action is to
use a single target. Currently, we are targeting .NET Standard 2.0 because that is the version
the [latest `Microsoft.CodeAnalysis.CSharp.Workspaces` package targets](
   It is [Microsoft's recommendation to target .NET Standard 2.0 where possible and discontinue
using .NET Standard 1.x](
because of the number of extra dependencies in .NET Standard 1.x. However, I noticed that
[Xunit.Analyzers is targeting .NET Standard 1.3](
and [StyleCop is targeting .NET Standard 1.1 and .NET Framework 4.5.2](,
although the only assembly that is shipped via NuGet is .NET Standard 1.1. This would seem
to confirm my suspicion that .NET Standard 1.x is required for multi-targeting VS2017 and
   So, basically I believe the fix for VS2017 support will be:
   1. Change the `TargetFramework` of [`Lucene.Net.CodeAnalysis.CSharp`](
and [`Lucene.Net.CodeAnalysis.VisualBasic`](
to `netstandard1.3`.
   2. Change the [target version](
of `Microsoft.CodeAnalysis.CSharp.Workspaces` and `Microsoft.CodeAnalysis.VisualBasic.Workspaces`
to < 3.0.0.
   We would be happy to accept a PR with these changes or to discuss alternatives if this
isn't a fix.
   ## Disabling Analyzers
   According to the documentation, [analyzers can be disabled for dependent projects](
So, I suggest adding the following to your project to see if it stops the dependent projects
from requiring the analyzers, also. Let us know whether this setting is helpful.
   <PackageReference Include="Lucene.Net" Version="4.8.0-beta00013" PrivateAssets="all"
   Note that the `Lucene.Net` NuGet package is the only one with code analyzers in it.

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