-
Notifications
You must be signed in to change notification settings - Fork 419
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
Simple test project produces many error messages #1291
Comments
This issue was moved to dotnet/vscode-csharp#2515 |
Sorry, I mistakenly moved your issue. |
Could you provide your full OmniSharp Log output? |
Here is a transcript of creating a test project and showing error messages with omnisharp. I translated some of the Spanish messages to English (but there were too many of them, btw, is there any way of setting omnisharp/vscode to English messages, for instance, with environment variables?)
{"seq": 1, "command": "/codecheck"}
|
I think I see the problem here. OmniSharp is initializing itself with the MSBuild from what appears to be a fairly old version of VS 2017 Express for Windows Desktop (15.4) on your machine. It is likely that the MSBuild there is not compatible with a .NET Core 2.1 project. You could try updating VS 2017 to the latest (15.8). |
Thanks for the suggestion. Updated VS 2017 Expess to 15.8.4, and still failing
|
Hmmm.... Any chance you could share the project? |
It is a trivial project created with "dotnet new mstest" |
I have the same issue as described. I have Visual Studio Express 2017 installed, which does not support dotnet core (hence exploring VS Code + the C# extenstion).# Looking at my logs its finding the version of msbuild installed with VS express. How do I change where it looks? I was just trying to follow this guide https://docs.microsoft.com/en-us/dotnet/core/testing/unit-testing-with-mstest Output from dotnet --info
Output from omnisharp log
|
I am facing the same issue when I create a project with "dotnet new xunit" and see the error for folder obj -> Debug -> netcoreapp2.2 -> AssemblyInfo.cs file //------------------------------------------------------------------------------ using System; [assembly: System.Reflection.AssemblyCompanyAttribute("GradeBook.Tests")] // Generated by the MSBuild WriteCodeFragment class. ***The one's in bold are all showing errors |
@DustinCampbell - is there any simple way to workaround this? Can I force omnisharp to look at a specific location for MSBuild rather than relying on it auto-finding the wrong one? |
Found this issue, seems to be that you need to rename the visual studio folder so that OmniSharp doesn't find it. Not a great solution. Would be much better if I could per-project point omnisharp at the version I want to use. |
After creating a simple test project
And opening it with Visual Studio Code, many compilation errors are reported by Omnisharp, like
The type 'AssemblyCompanyAttribute' exists in both 'System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' [MyProgram.Test]
Predefined type 'System.Object' is not defined or imported [MyProgram.Test]
In order to isolate the problem from Visual Studio Code, I ran it with omnisharp.exe using different versions.
and sending
to see the result of the C# check.
The problem happens with Omnisharp >= 1.31 . Omnisharp 1.30 works correctly. In addtion, if one creates a omnisharp.json
the problem goes away as well
Output of dotnet --info (Spanish output translated to English, maybe some message is not exact)
SDK de .NET Core (reflecting any global.json):
Version: 2.1.401
Commit: 91b1c13032
Runtime environment:
OS Name: Windows
OS Version: 10.0.17134
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\2.1.401\
Host (useful for support):
Version: 2.1.4
Commit: 85255dde3e
.NET Core SDKs installed:
2.1.401 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed:
Microsoft.NETCore.App 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
The text was updated successfully, but these errors were encountered: