Closed liphvf closed 2 years ago
@liphvf Something is off for sure. In particular this error in the omnisharpLog.txt.
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types.\\r\\nMethod 'get_MetadataToken' in type 'Microsoft.CodeAnalysis.CodeGeneration.CodeGenerationArrayTypeSymbol' from assembly 'Microsoft.CodeAnalysis.Workspaces, Version=3.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not have an implementation.
There is no reason for anything to have loaded Roslyn 3.8.0. O# does not reference 3.x Roslyn nor does it ship in the .NET 6 sdk. Having cloned and opened your repo I am unable to reproduce these error.
Have you made any modification to your dotnet sdk or omnisharp install directories? My current recommendation is to uninstall and reinstall the dotnet sdk as well as the VS Code C# extension.
If these issues persist, perhaps you can also share a list of your installed VS Code extensions.
Hi @JoeRobich.
1- I uninstall all .NET SDK except Microsoft .NET SDK 6.0.200 (x64) from Visual Studio and install .NET 6 SDK 6.0.200. 2- Disable all extensions with use C# in vscode and uninstall C# and install again.
Unfortunately, i has same erros. That is a new log Error: https://github.com/liphvf/anisync/blob/isolete-omnisharp-problem/omnisharpLogAfterReinstall.txt.
If help, bellow has a list of extensions installed now:
aliasadidev.nugetpackagemanagergui@1.1.9 blackmist.LinkCheckMD@0.3.1 DavidAnson.vscode-markdownlint@0.46.0 docsmsft.docs-article-templates@0.2.11 docsmsft.docs-authoring-pack@0.1.15 docsmsft.docs-build@0.3.9 docsmsft.docs-images@0.0.9 docsmsft.docs-linting@0.0.9 docsmsft.docs-markdown@0.2.100 docsmsft.docs-metadata@1.0.7 docsmsft.docs-preview@0.3.57 docsmsft.docs-scaffolding@0.0.12 docsmsft.docs-visual-areas@0.2.1 docsmsft.docs-yaml@0.2.7 DotJoshJohnson.xml@2.5.1 Dunn.redis@1.4.0 eamodio.gitlens@12.0.1 foxundermoon.shell-format@7.2.2 fullstackspider.visual-nuget@0.2.1 GitHub.copilot@1.7.5227 GitHub.remotehub@0.26.0 joshuapoehls.json-escaper@1.1.2 k--kato.docomment@0.1.30 kreativ-software.csharpextensions@1.6.0 LouisWT.regexp-preview@0.1.5 ms-dotnettools.csharp@1.24.1 ms-dotnettools.dotnet-interactive-vscode@1.0.3103011 ms-dotnettools.vscode-dotnet-runtime@1.5.0 ms-edgedevtools.vscode-edge-devtools@1.4.5 ms-ossdata.vscode-postgresql@0.3.0 ms-toolsai.jupyter@2022.2.1030672458 ms-toolsai.jupyter-keymap@1.0.0 ms-toolsai.jupyter-renderers@1.0.6 ms-vscode-remote.remote-ssh@0.76.1 ms-vscode-remote.remote-ssh-edit@0.76.1 ms-vscode-remote.remote-wsl@0.64.2 ms-vscode.cpptools@1.8.4 ms-vsliveshare.vsliveshare@1.0.5418 mtxr.sqltools@0.23.0 mtxr.sqltools-driver-pg@0.2.0 patcx.vscode-nuget-gallery@0.0.24 PKief.material-icon-theme@4.14.0 quicktype.quicktype@12.0.46 redhat.vscode-commons@0.0.6 redhat.vscode-yaml@1.5.0 shd101wyy.markdown-preview-enhanced@0.6.2 shuworks.vscode-table-formatter@1.2.1 sterin.msbuild-tools@0.0.12 streetsidesoftware.code-spell-checker@2.1.7 streetsidesoftware.code-spell-checker-portuguese-brazilian@2.0.5 tintoy.msbuild-project-tools@0.4.3 VisualStudioExptTeam.vscodeintellicode@1.2.17
Tomorrow i will test in another machine and go back to comment.
Thanks for your attention.
@liphvf Ok, taking a look at the new log and I notice:
[info]: OmniSharp.OmniSharpWorkspace
Adding analyzer reference: C:\Users\liphv\.nuget\packages\strawberryshake.codegeneration.csharp.analyzers\12.6.2\analyzers\dotnet\cs\Microsoft.CodeAnalysis.CSharp.Workspaces.dll
[info]: OmniSharp.OmniSharpWorkspace
Adding analyzer reference: C:\Users\liphv\.nuget\packages\strawberryshake.codegeneration.csharp.analyzers\12.6.2\analyzers\dotnet\cs\Microsoft.CodeAnalysis.CSharp.dll
[info]: OmniSharp.OmniSharpWorkspace
Adding analyzer reference: C:\Users\liphv\.nuget\packages\strawberryshake.codegeneration.csharp.analyzers\12.6.2\analyzers\dotnet\cs\Microsoft.CodeAnalysis.Workspaces.dll
[info]: OmniSharp.OmniSharpWorkspace
Adding analyzer reference: C:\Users\liphv\.nuget\packages\strawberryshake.codegeneration.csharp.analyzers\12.6.2\analyzers\dotnet\cs\Microsoft.CodeAnalysis.dll
I find it unexpected that an analyzer is shipping it's own copy of Roslyn. Looking at the tag for the release you are using and sure enough here is the source of the 3.8.0 Roslyn - https://github.com/ChilliCream/hotchocolate/blob/12.6.2/src/StrawberryShake/SourceGenerator/src/CodeGeneration.CSharp.Analyzers/StrawberryShake.CodeGeneration.CSharp.Analyzers.csproj
I will have to check around to find out what our expected load behavior should be in this case.
If you could try updating your reference to use version 13.0.0-preview.9 and see if you have better luck.
HI @JoeRobich ,
I am testing change StrawberryShake to 13.0.0-preview.9 and 13.0.0-preview.11. In this version, the application won`t build because ambiguous erros appears.
Same result in another machine.
BUT, after update dotnet SDK to version 6.0.201. All errors disappear. 😄
Thanks for all.
For no how reason. That erros appear again. I use that issue to report StrawberryShake. Thanks for all.
When i report that erro for StrawberryShake, I noticed that:
Sometimes, after build another obj folder outside of project folder has created with 2 files GraphQlClient.code and GraphQlClient.GraphQlClient.CSharp.md5 . Exemplo:
├── anisync │ ├── anisync.csproj │ ├── bin │ │ └── Debug │ │ └── net6.0 │ │ ├── anisync.deps.json │ │ ├── anisync.dll │ │ ├── anisync.exe │ │ ├── anisync.pdb │ │ ├── anisync.runtimeconfig.json │ │ ├── Microsoft.Extensions.Configuration.Abstractions.dll │ │ ├── Microsoft.Extensions.Configuration.Binder.dll │ │ ├── Microsoft.Extensions.Configuration.dll │ │ ├── Microsoft.Extensions.DependencyInjection.Abstractions.dll │ │ ├── Microsoft.Extensions.DependencyInjection.dll │ │ ├── Microsoft.Extensions.Http.dll │ │ ├── Microsoft.Extensions.Logging.Abstractions.dll │ │ ├── Microsoft.Extensions.Logging.dll │ │ ├── Microsoft.Extensions.Options.dll │ │ ├── Microsoft.Extensions.Primitives.dll │ │ ├── Newtonsoft.Json.dll │ │ ├── StrawberryShake.Core.dll │ │ ├── StrawberryShake.Resources.dll │ │ ├── StrawberryShake.Tools.Configuration.dll │ │ └── StrawberryShake.Transport.Http.dll │ ├── GraphQlClients │ │ ├── Generated │ │ │ └── GraphQlClient.StrawberryShake.cs │ │ ├── Queries │ │ │ └── GetUserId.graphql │ │ ├── schema.extensions.graphql │ │ └── schema.graphql │ ├── LICENSE │ ├── obj │ │ ├── anisync.csproj.nuget.dgspec.json │ │ ├── anisync.csproj.nuget.g.props │ │ ├── anisync.csproj.nuget.g.targets │ │ ├── berry │ │ │ ├── GraphQlClient.code │ │ │ └── GraphQlClient.GraphQlClient.CSharp.md5 │ │ ├── Debug │ │ │ └── net6.0 │ │ │ ├── anisync.AssemblyInfo.cs │ │ │ ├── anisync.AssemblyInfoInputs.cache │ │ │ ├── anisync.assets.cache │ │ │ ├── anisync.csproj.AssemblyReference.cache │ │ │ ├── anisync.csproj.BuildWithSkipAnalyzers │ │ │ ├── anisync.csproj.CopyComplete │ │ │ ├── anisync.csproj.CoreCompileInputs.cache │ │ │ ├── anisync.csproj.FileListAbsolute.txt │ │ │ ├── anisync.dll │ │ │ ├── anisync.GeneratedMSBuildEditorConfig.editorconfig │ │ │ ├── anisync.genruntimeconfig.cache │ │ │ ├── anisync.GlobalUsings.g.cs │ │ │ ├── anisync.pdb │ │ │ ├── apphost.exe │ │ │ ├── ref │ │ │ │ └── anisync.dll │ │ │ └── refint │ │ │ └── anisync.dll │ │ ├── project.assets.json │ │ └── project.nuget.cache │ ├── omnisharpLogAfterReinstall.txt │ ├── omnisharpLog.txt │ ├── Program.cs │ └── README.md └── obj <-- HERE! └── berry ├── GraphQlClient.code └── GraphQlClient.GraphQlClient.CSharp.md5
Resolved with this: https://github.com/ChilliCream/hotchocolate/issues/4823
I have a bunch of erro in vscode with Ambiguity between class and methods. Like image bellow:
I created a branch in my repository to isolate that problem: https://github.com/liphvf/anisync/tree/isolete-omnisharp-problem Just build or run. That problem appears.
I don`t have any problem in visual studio 2022.
Vscode Version: 1.65.0. Dotnet Version: 6.0.200
For more help, my repository has a log in https://github.com/liphvf/anisync/blob/isolete-omnisharp-problem/omnisharpLog.txt and readme describe all information i have.
Thanks for all.