You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by GitBox <gi...@apache.org> on 2020/07/24 18:49:07 UTC

[GitHub] [lucenenet] lazcool opened a new issue #286: Build warning since v4.8.0-beta00008

lazcool opened a new issue #286:
URL: https://github.com/apache/lucenenet/issues/286


   Since updating to v4.8.0-beta00008, when I build my project, I get this build error:
   
   Analyzer 'Lucene.Net.CodeAnalysis.Lucene1000_TokenStreamOrItsIncrementTokenMethodMustBeSealedAnalyzer' threw an exception of type 'System.IO.FileNotFoundException' with message 'Could not load file or assembly 'Microsoft.CodeAnalysis.VisualBasic, Version=3.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.'.
   
   I've created an empty project and added all the references my project uses and that builds fine.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [lucenenet] NightOwl888 closed issue #286: Build warning since v4.8.0-beta00008

Posted by GitBox <gi...@apache.org>.
NightOwl888 closed issue #286:
URL: https://github.com/apache/lucenenet/issues/286


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [lucenenet] NightOwl888 closed issue #286: Build warning since v4.8.0-beta00008

Posted by GitBox <gi...@apache.org>.
NightOwl888 closed issue #286:
URL: https://github.com/apache/lucenenet/issues/286


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [lucenenet] deanmarcussen commented on issue #286: Build warning since v4.8.0-beta00008

Posted by GitBox <gi...@apache.org>.
deanmarcussen commented on issue #286:
URL: https://github.com/apache/lucenenet/issues/286#issuecomment-663676427


   For info this issue resurfaced on `4.8.0-beta00010` for me.
   
   Downgraded to `4.8.0-beta00009` worked fine, downgraded to `4.8.0-beta00008` same error.
   
   Resolved by upgrading the dotnet core sdk (I was one dot release behind)
   
   MacOS


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [lucenenet] Piedone commented on issue #286: Build warning since v4.8.0-beta00008

Posted by GitBox <gi...@apache.org>.
Piedone commented on issue #286:
URL: https://github.com/apache/lucenenet/issues/286#issuecomment-674324678


   I'm getting the warning on `4.8.0-beta00010` with SDK v`3.1.302`. Cleared the NuGet cache, restarted (Windows Server). There are no other versions restored and visible in the NuGet cache so indeed this is the only version being used.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [lucenenet] NightOwl888 commented on issue #286: Build warning since v4.8.0-beta00008

Posted by GitBox <gi...@apache.org>.
NightOwl888 commented on issue #286:
URL: https://github.com/apache/lucenenet/issues/286#issuecomment-663681169


   Strange. My guess is a bug in certain SDKs. I confirmed that `4.8.0-beta00010` and  `4.8.0-beta00011` didn't present the problem before starting the release vote.
   
   Just out of curiosity, does upgrading the SDK "fix" `4.8.0-beta00008`? I am seeing the problem in that version, but not in any of the others. I am using SDK version `3.1.301` to build locally and on the CI environment. I also checked both .NET Framework 4.7.2 and .NET Core 3.1 and the behavior seemed consistent on both targets.
   
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [lucenenet] deanmarcussen commented on issue #286: Build warning since v4.8.0-beta00008

Posted by GitBox <gi...@apache.org>.
deanmarcussen commented on issue #286:
URL: https://github.com/apache/lucenenet/issues/286#issuecomment-663833490


   Our CI built `4.8.0-beta00011` fine as well.
   
   Think I figured it out.
   
   NuGet version weirdness / background dotnet / OmniSharp processes keeping the wrong dll version in memory (what @iwillspeak  refers to essentially, about the analyzer staying loaded in memory)
   
   With SDK `3.1.302`
   Went to build `4.8.0-beta00011` and it failed.
   Dropping back to every other version, since `4.8.0-beta00008` and it succeeded
   
   Dropped back to `3.1.106` and everything started failing except `4.8.0-beta00010`
   
   Cleared out the `NuGet` cache of all my `Lucene.Net` packages and went back to SDK `3.1.302` and `4.8.0-beta00011` and it builds ok.
   
   Drop back to version `4.8.0-beta00010` and it builds.
   Then build `4.8.0-beta00011` and it fails.
   Delete the `4.8.0-beta00010` from the NuGet cache and version `4.8.0-beta00011` builds fine.
   
   Do the above process again with a `killall dotnet` between version upgrades and it built the new version fine.
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [lucenenet] iwillspeak commented on issue #286: Build warning since v4.8.0-beta00008

Posted by GitBox <gi...@apache.org>.
iwillspeak commented on issue #286:
URL: https://github.com/apache/lucenenet/issues/286#issuecomment-642533649


   I was able to work around this by excluding the analyzers from `Lucene.Net`:
   
   ```msbuild
   <PackageReference Include="Lucene.Net" Version="4.8.0-beta00008" NoWarn="NU5104;AD0001">
     <ExcludeAssets>analyzers</ExcludeAssets>
   </PackageReference>
   ```
   
   You'll need to make sure that you kill any existing background compiler processes though after making that change otherwise the analyzer will remain loaded.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [lucenenet] NightOwl888 commented on issue #286: Build warning since v4.8.0-beta00008

Posted by GitBox <gi...@apache.org>.
NightOwl888 commented on issue #286:
URL: https://github.com/apache/lucenenet/issues/286#issuecomment-630043779


   We were able to remove a bit of runtime Reflection code by making the functionality into a [Roslyn Analyzer Code Fix](https://docs.microsoft.com/en-us/dotnet/csharp/roslyn-sdk/tutorials/how-to-write-csharp-analyzer-code-fix).
   
   A [single assembly](https://github.com/apache/lucenenet/tree/master/src/dotnet/Lucene.Net.CodeAnalysis) was used for both the C# and VB analyzers, therefore that assembly has dependencies on both
   
   - [Microsoft.CodeAnalysis.CSharp.Workspaces](https://www.nuget.org/packages/Microsoft.CodeAnalysis.CSharp.Workspaces)
   - [Microsoft.CodeAnalysis.VisualBasic.Workspaces](https://www.nuget.org/packages/Microsoft.CodeAnalysis.VisualBasic.Workspaces)
   
   This appears to be the problem, but what isn't clear is why it is a problem as it is supposed to be possible to put multiple language support into the same analyzer.
   
   A clue can be found in [the documentation](https://docs.microsoft.com/en-us/archive/msdn-magazine/2015/october/code-analysis-build-and-deploy-libraries-with-integrated-roslyn-code-analysis-to-nuget#building-a-nuget-package-that-includes-apis-and-analyzers) in that it is not clear on what to do in the case where you are supporting 2 languages only without having a language-agnostic library (as in our case).
   
   > analyzers folder: This folder contains analyzer .dll files organized into particular subfolders. **Agnostic analyzer libraries (that is, targeting all languages) reside in a subfolder called dotnet. Analyzers targeting C# reside in a subfolder called dotnet\cs, whereas analyzers targeting Visual Basic reside in a folder called dotnet\vb.** It’s worth mentioning that dotnet represents the NuGet profile for .NET Core, and supports projects types such as Universal Windows apps and ASP.NET 5 projects.
   
   Since the answer was **not** to put the same compiled DLL into both the `dotnet\cs` and `dotnet\vb` folders, the only options that seem to remain are:
   
   1. Put the assembly into the `dotnet` folder
   2. Add conditional compilation and/or multiple projects to the assembly so only one language is supported per assembly (with only the `PackageReference` dependencies that apply to that language)
   
   So, this is a bug. 
   
   If someone were to be so kind as to solve this puzzle for us and submit a PR we would appreciate it. Note that the deployment code that packs the analyzer into the Lucene.Net NuGet package is located [here](https://github.com/apache/lucenenet/blob/00680bad64adf0842cebe9aa5d9855544b7512b0/src/Lucene.Net/Lucene.Net.csproj#L37-L46).


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [lucenenet] dotnetshadow commented on issue #286: Build warning since v4.8.0-beta00008

Posted by GitBox <gi...@apache.org>.
dotnetshadow commented on issue #286:
URL: https://github.com/apache/lucenenet/issues/286#issuecomment-629946019


   Getting the same warning when building. Is another package required?


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [lucenenet] NightOwl888 commented on issue #286: Build warning since v4.8.0-beta00008

Posted by GitBox <gi...@apache.org>.
NightOwl888 commented on issue #286:
URL: https://github.com/apache/lucenenet/issues/286#issuecomment-657138665


   I started looking into this and couldn't reproduce it. Then I realized I was using 4.8.0-beta00009 instead of 4.8.0-beta00008 and sure enough, 4.8.0-beta00008 is presenting the problem. Since we didn't change anything regarding the analyzers between those 2 versions, I am at a loss to explain why the problem existed in the first place or why it suddenly disappeared.
   
   Doing a fresh build from source also doesn't present the problem.
   
   I am closing this issue for now, but feel free to reopen it if you see this problem appear in a future release.
   
   


----------------------------------------------------------------
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:
users@infra.apache.org