Closed promontis closed 2 years ago
@promontis In this case you require a newer .NET 6 SDK. From the OmniSharp output I see you are using the 6.0.2xx SDKs which align with VS 17.1. The source generator is trying to load Roslyn 4.2 dependencies which align with VS 17.2.
Latest SDK solved it!! Thnx!!!
Issue Description
I'm trying to use the sample project of DotNetJS (https://github.com/Elringus/DotNetJS). This project generates an interop between c# and js, using a source generator. When I run
dotnet publish
(which triggers the source generator) in VS Code on a Mac, I get the following exception:Note, that it does work on Windows!
Is it not possible to use source generators in VS Code on a Mac?
Steps to Reproduce
On a Mac (Windows works)... Clone https://github.com/Elringus/DotNetJS Open repo using VS Code Open Terminal in VS Code Cd to
Samples/HelloWorld/Project
Rundotnet publish
Expected Behavior
To not get an exception, and the source generator is running.
Actual Behavior
Exception.
Logs
OmniSharp log
Starting OmniSharp server at 9/30/2022, 11:20:05 PM Target: /Users/michel/Dev/stylister-garden-cra
OmniSharp server started with .NET 6.0.202 . Path: /Users/michel/.vscode/extensions/ms-dotnettools.csharp-1.25.0-darwin-arm64/.omnisharp/1.39.0-net6.0/OmniSharp.dll PID: 80684
Environment information
VSCode version: 1.71.2 C# Extension: 1.25.0
Mono Information
OmniSharp using mono :6.12.0Dotnet Information
.NET SDK (reflecting any global.json): Version: 6.0.202 Commit: f8a55617d2 Runtime Environment: OS Name: Mac OS X OS Version: 12.0 OS Platform: Darwin RID: osx.12-arm64 Base Path: /usr/local/share/dotnet/sdk/6.0.202/ Host (useful for support): Version: 6.0.4 Commit: be98e88c76 .NET SDKs installed: 6.0.201 [/usr/local/share/dotnet/sdk] 6.0.202 [/usr/local/share/dotnet/sdk] .NET runtimes installed: Microsoft.AspNetCore.App 6.0.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.4 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 6.0.3 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] To install additional .NET runtimes or SDKs: https://aka.ms/dotnet-downloadVisual Studio Code Extensions
|Extension|Author|Version| |---|---|---| |add-reference|adrianwilczynski|1.0.2| |Antlrvsix-vscode|KenDomino|1.2.0| |csharp|ms-dotnettools|1.25.0| |csharpier-vscode|csharpier|1.3.5| |dotnet|formulahendry|0.0.4| |dotnet-test-explorer|formulahendry|0.7.8| |EditorConfig|EditorConfig|0.16.4| |nugetpackagemanagergui|aliasadidev|2.0.4| |prettier-vscode|esbenp|9.9.0| |vscode-eslint|dbaeumer|2.2.6| |vscode-graphql|GraphQL|0.7.5| |vscode-graphql-syntax|GraphQL|1.0.4| |vscode-jest-runner|firsttris|0.4.57| |vscode-nuget-gallery|patcx|0.0.24| |vscode-nuget-package-manager|jmrog|1.1.6| |vscode-sort-json|richie5um2|1.20.0| |vscode-tailwindcss|bradlc|0.8.7| |vscode-xml|redhat|0.21.2022062916|;