-
Notifications
You must be signed in to change notification settings - Fork 689
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Omnisharp doesn't find System on Dotnet SDK >= 3.0 #3917
Comments
looks like you have an outdated installation of global Mono. please update to at least 6.4 (ideally 6.10) |
I already have Mono 6.10
|
yes but it must be missing the necessary msbuild (16.3+) |
|
I am not very familiar with Arch but we have only partial support for ot though see https://github.com/OmniSharp/omnisharp-roslyn#introduction what your log shows is that the global mono you have doesn't have correct new msbuild bundled, hence the problem what you need is the equivalent of mono-devel for Ubuntu |
I believe that Arch has a msbuild-stable package that is known to work. See this comment #3769 (comment) |
ah thanks @JoeRobich I couldn't find that. |
I replaced |
I can confirm that I'm experiencing this too. msbuild-stable sadly doesn't seem to resolve anything. This issue also persists on the flatpak version, which can make sense since it seems to be referencing local packages as well. Pressing F5 seems to be a decent workaround for now as it seems to help highlight actual issues in the code :) |
I have this issue on macOS. Using stable mono 6.10, tried 6.12 too, but no go. I can only get OmniSharp 1.23.4 to provide partial IntelliSense for dotnet core projects. It can't handle any references to System.Threading.* using the global mono but it does work if I change to I'd leave it at that but I can't use the Basically, in order to keep working, I can only have one project open at a time and I have to swap the omnisharp.useGlobalMono setting to and from always and never before changing projects. I wish I understood the real issue so I could address it. |
the problem is the incompatibility between the lowest MSBuild version required by the new .NET Core SDKs (16.7+) and the version available in any publicly available Mono (16.6) the bundled Mono of Omnisharp is something we build ourselves so it has 16.8 and hence it works with latest.NET Core including .NET 5.0 you can find more info here #4007 (comment) and here mono/mono#20250 |
Thanks so much @filipw! I was able to configure an environment that works for Unity and DotNet Core at the same time with your information. Here is what I had to do to work in VSCode in both Unity and DotNet core without changing the
|
Closing as the modern .NET builds of O# should be used instead of the .NET Framework when loading SDK projects. |
Issue Description
When I open a Project with OmniSharp and the target Framework is set to 2.1, it works perfectly, but if i go higher than that (>= 3.0), it just says "The type or namespace name 'System' could not be found". It works perfectly when I press F5, or do dotnet run
Steps to Reproduce
Create any .NET Core >= 3.0 project and try to use Omnisharp
Expected Behavior
It should work on any .NET Core version
Actual Behavior
It doesn't and can't find any .NET Core classes
Logs
OmniSharp log
Starting OmniSharp on arch 0.0 (x64)
info: OmniSharp.Services.DotNetCliService
DotNetPath set to dotnet
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 2 MSBuild instance(s)
1: Mono 16.4 - "/usr/lib/mono/msbuild/Current/bin"
2: StandAlone 16.4 - "/home/noah/.vscode/extensions/ms-dotnettools.csharp-1.22.1/.omnisharp/1.35.3/omnisharp/.msbuild/Current/Bin"
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: Mono 16.4 - "/usr/lib/mono/msbuild/Current/bin"
CscToolExe = csc.exe
CscToolPath = /home/noah/.vscode/extensions/ms-dotnettools.csharp-1.22.1/.omnisharp/1.35.3/omnisharp/.msbuild/Current/Bin/Roslyn
info: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in '/home/noah/soda-lake-s-share/code/c#/hi'.
info: OmniSharp.Cake.CakeProjectSystem
Could not find any Cake files
info: OmniSharp.MSBuild.ProjectSystem
No solution files found in '/home/noah/soda-lake-s-share/code/c#/hi'
info: OmniSharp.MSBuild.ProjectManager
Queue project update for '/home/noah/soda-lake-s-share/code/c#/hi/hi.csproj'
info: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in '/home/noah/soda-lake-s-share/code/c#/hi'.
info: OmniSharp.Script.ScriptProjectSystem
Could not find any CSX files
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.ImplementTypeWorkspaceOptionsProvider, Order: 110
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.BlockStructureWorkspaceOptionsProvider, Order: 140
info: OmniSharp.MSBuild.ProjectManager
Loading project: /home/noah/soda-lake-s-share/code/c#/hi/hi.csproj
info: OmniSharp.WorkspaceInitializer
Configuration finished.
info: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location '/home/noah/soda-lake-s-share/code/c#/hi' on host 119063.
info: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file '/home/noah/soda-lake-s-share/code/c#/hi/hi.csproj'.
info: OmniSharp.MSBuild.ProjectManager
Adding project '/home/noah/soda-lake-s-share/code/c#/hi/hi.csproj'
info: OmniSharp.MSBuild.ProjectManager
Update project: hi
info: OmniSharp.MSBuild.ProjectManager
Queue project update for '/home/noah/soda-lake-s-share/code/c#/hi/hi.csproj'
info: OmniSharp.MSBuild.ProjectManager
Loading project: /home/noah/soda-lake-s-share/code/c#/hi/hi.csproj
info: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file '/home/noah/soda-lake-s-share/code/c#/hi/hi.csproj'.
info: OmniSharp.MSBuild.ProjectManager
Update project: hi
[warn]: OmniSharp.MSBuild.PackageDependencyChecker
hi: Did not find 'Microsoft.NETCore.App' in lock file.
info: OmniSharp.MSBuild.ProjectManager
Queue project update for '/home/noah/soda-lake-s-share/code/c#/hi/hi.csproj'
info: OmniSharp.MSBuild.ProjectManager
Queue project update for '/home/noah/soda-lake-s-share/code/c#/hi/hi.csproj'
info: OmniSharp.MSBuild.ProjectManager
Queue project update for '/home/noah/soda-lake-s-share/code/c#/hi/hi.csproj'
info: OmniSharp.MSBuild.ProjectManager
Queue project update for '/home/noah/soda-lake-s-share/code/c#/hi/hi.csproj'
info: OmniSharp.MSBuild.ProjectManager
Loading project: /home/noah/soda-lake-s-share/code/c#/hi/hi.csproj
info: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file '/home/noah/soda-lake-s-share/code/c#/hi/hi.csproj'.
info: OmniSharp.MSBuild.ProjectManager
Update project: hi
info: OmniSharp.MSBuild.ProjectManager
Queue project update for '/home/noah/soda-lake-s-share/code/c#/hi/hi.csproj'
info: OmniSharp.MSBuild.ProjectManager
Loading project: /home/noah/soda-lake-s-share/code/c#/hi/hi.csproj
info: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file '/home/noah/soda-lake-s-share/code/c#/hi/hi.csproj'.
info: OmniSharp.MSBuild.ProjectManager
Update project: hi
info: OmniSharp.Roslyn.CSharp.Services.Diagnostics.ReAnalyzeService
Queue analysis for all projects.
The text was updated successfully, but these errors were encountered: