Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Roslynator.Analyzers #1496

Closed
timjroberts opened this issue May 15, 2019 · 5 comments
Closed

Roslynator.Analyzers #1496

timjroberts opened this issue May 15, 2019 · 5 comments

Comments

@timjroberts
Copy link

timjroberts commented May 15, 2019

The latest build of Omnisharp Roslyn fails to use the referenced Roslynator.Analyzers package for a given project, giving the following error repeated multiple times:

Could not load signature of Roslynator.CSharp.Analysis.UnconstrainedTypeParameterCheckedForNullAnalyzer:Analyze due to:
Could not load file or assembly 'Roslynator.CSharp, Version=1.0.0.8, Culture=neutral, PublicKeyToken=390be46f77b79f52' or one of its dependencies.

This has been working but appears to have begun failing since 1.32.19.

dotnet --info

.NET Core SDK (reflecting any global.json):
 Version:   2.2.203
 Commit:    e5bab63eca

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.13
 OS Platform: Darwin
 RID:         osx.10.13-x64
 Base Path:   /usr/local/share/dotnet/sdk/2.2.203/

Host (useful for support):
  Version: 2.2.4
  Commit:  f95848e524

.NET Core SDKs installed:
  2.1.202 [/usr/local/share/dotnet/sdk]
  2.1.403 [/usr/local/share/dotnet/sdk]
  2.2.101 [/usr/local/share/dotnet/sdk]
  2.2.203 [/usr/local/share/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.5 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.2.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.2.4 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.5 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.2.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.2.4 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.0.9 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

mono --version

Mono JIT compiler version 5.18.1.3 (2018-08/fdb26b0a445 Wed Mar 20 10:02:02 EDT 2019)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
        TLS:           
        SIGSEGV:       altstack
        Notification:  kqueue
        Architecture:  amd64
        Disabled:      none
        Misc:          softdebug 
        Interpreter:   yes
        LLVM:          yes(600)
        Suspend:       preemptive
        GC:            sgen (concurrent by default)
@filipw
Copy link
Member

filipw commented May 15, 2019

The analyzers are shadow copied since 1.32.19 so I suspect this is the root cause for the error #1474
do you have a repro project? can you post a full omnisharp log at debug level? which version of Roslynator.Analyzers is this, 2.0.0?

thanks

@timjroberts
Copy link
Author

Yes, version 2.0.0 of the Roslynator.Analyzers package.

I've just created a Console Application:

dotnet new sln -n AnalyzersTest
dotnet new console -n ConsoleApp
dotnet sln add ./ConsoleApp
dotnet add ./ConsoleApp/ package Roslynator.Analyzers -v 2.0.0

Reloaded the VS Code window, and all is working as expected. I get reported violations if I introduce one. It still fails in my existing project though. I've attached the Omnisharp Log at debug level.
omnisharp-debug.log.txt

It may be Mono related? I did install VS for Mac 2019 which required the later Mono. I'll try downgrading Mono, but it doesn't explain why it works in a new solution.

@filipw
Copy link
Member

filipw commented May 16, 2019

Fixed with #1497

@filipw filipw closed this as completed May 16, 2019
@timjroberts
Copy link
Author

Installed the latest VSCode (1.34.0) and the latest omnisharp.roslyn (1.32.20-beta.15) and all appears to be working again.
Thanks @filipw and @savpek. Absolutely love have Analyzer support!

@filipw
Copy link
Member

filipw commented May 17, 2019

oh great! 👍

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants