Skip to content
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

Open
ramon-garcia opened this issue Sep 11, 2018 · 12 comments
Open

Simple test project produces many error messages #1291

ramon-garcia opened this issue Sep 11, 2018 · 12 comments

Comments

@ramon-garcia
Copy link

ramon-garcia commented Sep 11, 2018

After creating a simple test project

dotnet new mstest

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.

omnisharp.exe -stdio

and sending

{"seq": 1, "Command": "/codecheck" }

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

{
"MSBuild": {
"UseLegacySdkResolver": true
}
}

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


@DustinCampbell
Copy link
Contributor

This issue was moved to dotnet/vscode-csharp#2515

@DustinCampbell
Copy link
Contributor

Sorry, I mistakenly moved your issue.

@DustinCampbell
Copy link
Contributor

Could you provide your full OmniSharp Log output?

@ramon-garcia
Copy link
Author

ramon-garcia commented Sep 12, 2018

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?)

C:\testomni>dotnet new mstest

The template "Unit Test Project" was created correcty

Processing further actions...
Executing "dotnet restore" in C:\testomni\testomni.csproj...
  Restoring packages for C:\testomni\testomni.csproj...
  Generation of file MSBuild C:\testomni\obj\testomni.csproj.nuget.g.props.
  Generation of file MSBuild C:\testomni\obj\testomni.csproj.nuget.g.targets.
  Restoring performed in 676,59 ms for C:\testomni\testomni.csproj.

Restoring successful

C:\testomni>"c:\Users\ramon\.vscode\extensions\ms-vscode.csharp-1.16.0.omnisharp\1.32.4\OmniSharp.exe" -stdio

{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Stdio.Host","Message":"Starting OmniSharp on Windows 6.2.9200.0 (x64)"},"Seq":1,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Services.DotNetCliService","Message":"DotNetPath set to dotnet"},"Seq":2,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.MSBuild.Discovery.MSBuildLocator","Message":"Located 2 MSBuild instance(s)\r\n            1: Visual Studio 2017 Express para escritorio 15.4.27004.2009 - \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\WDExpress\\MSBuild\\15.0\\Bin\"\r\n            2: StandAlone 15.0 - \"C:\\Users\\ramon\\.vscode\\extensions\\ms-vscode.csharp-1.16.0\\.omnisharp\\1.32.4\\msbuild\\15.0\\Bin\""},"Seq":3,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.MSBuild.Discovery.MSBuildLocator","Message":"Registered MSBuild instance: Visual Studio 2017 Express para escritorio 15.4.27004.2009 - \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\WDExpress\\MSBuild\\15.0\\Bin\""},"Seq":4,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Cake.CakeProjectSystem","Message":"Detecting Cake files in 'C:\\testomni'."},"Seq":5,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Cake.CakeProjectSystem","Message":"Could not find any Cake files"},"Seq":6,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Stdio.Host","Message":"Project system 'OmniSharp.DotNet.DotNetProjectSystem' is disabled in the configuration."},"Seq":7,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.MSBuild.ProjectSystem","Message":"No solution files found in 'C:\\testomni'"},"Seq":8,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.MSBuild.ProjectManager","Message":"Queue project update for 'C:\\testomni\\testomni.csproj'"},"Seq":9,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Script.ScriptProjectSystem","Message":"Detecting CSX files in 'C:\\testomni'."},"Seq":10,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Script.ScriptProjectSystem","Message":"Could not find any CSX files"},"Seq":11,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Stdio.Host","Message":"Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpWorkspaceOptionsProvider"},"Seq":12,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Stdio.Host","Message":"Configuration finished."},"Seq":13,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Stdio.Host","Message":"Omnisharp server running using Stdio at location 'C:\\testomni' on host -1."},"Seq":14,"Type":"event"}
{"Event":"started","Body":null,"Seq":15,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.MSBuild.ProjectManager","Message":"Loading project: C:\\testomni\\testomni.csproj"},"Seq":16,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.MSBuild.ProjectManager","Message":"Successfully loaded project file 'C:\\testomni\\testomni.csproj'."},"Seq":17,"Type":"event"}
{"Event":"MsBuildProjectDiagnostics","Body":{"FileName":"C:\\testomni\\testomni.csproj","Warnings":[],"Errors":[]},"Seq":18,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.MSBuild.ProjectManager","Message":"Adding project 'C:\\testomni\\testomni.csproj'"},"Seq":19,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.MSBuild.ProjectManager","Message":"Update project: testomni"},"Seq":20,"Type":"event"}
{"Event":"ProjectAdded","Body":{"MsBuildProject":{"ProjectGuid":"00000000-0000-0000-0000-000000000000","Path":"C:\\testomni\\testomni.csproj","AssemblyName":"testomni","TargetPath":"C:\\testomni\\bin\\Debug\\netcoreapp2.1\\testomni.dll","TargetFramework":".NETCoreApp,Version=v2.1","SourceFiles":["C:\\testomni\\UnitTest1.cs","C:\\Temp\\.NETCoreApp,Version=v2.1.AssemblyAttributes.cs","C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.Program.cs","C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.AssemblyInfo.cs"],"TargetFrameworks":[{"Name":".NETCoreApp","FriendlyName":".NETCoreApp","ShortName":"netcoreapp2.1"}],"OutputPath":"bin\\Debug\\netcoreapp2.1\\","IsExe":true,"IsUnityProject":false}},"Seq":21,"Type":"event"}
{"Event":"ProjectChanged","Body":{"MsBuildProject":{"ProjectGuid":"00000000-0000-0000-0000-000000000000","Path":"C:\\testomni\\testomni.csproj","AssemblyName":"testomni","TargetPath":"C:\\testomni\\bin\\Debug\\netcoreapp2.1\\testomni.dll","TargetFramework":".NETCoreApp,Version=v2.1","SourceFiles":["C:\\testomni\\UnitTest1.cs","C:\\Temp\\.NETCoreApp,Version=v2.1.AssemblyAttributes.cs","C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.Program.cs","C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.AssemblyInfo.cs"],"TargetFrameworks":[{"Name":".NETCoreApp","FriendlyName":".NETCoreApp","ShortName":"netcoreapp2.1"}],"OutputPath":"bin\\Debug\\netcoreapp2.1\\","IsExe":true,"IsUnityProject":false}},"Seq":22,"Type":"event"}

{"seq": 1, "command": "/codecheck"}

{"Request_seq":1,"Command":"/codecheck","Running":true,"Success":true,"Message":null,"Body":{"QuickFixes":[{"LogLevel":"Error","Id":"CS0518","FileName":"C:\\testomni\\UnitTest1.cs","Line":5,"Column":6,"EndLine":5,"EndColumn":15,"Text":"The predefiend type 'System.Object' is neither defined nor imported","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0616","FileName":"C:\\testomni\\UnitTest1.cs","Line":5,"Column":6,"EndLine":5,"EndColumn":15,"Text":"'TestClassAttribute' is not an attribute class","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0518","FileName":"C:\\testomni\\UnitTest1.cs","Line":5,"Column":6,"EndLine":5,"EndColumn":15,"Text":"The predefined type 'System.Void' is neither defined nor imported","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0518","FileName":"C:\\testomni\\UnitTest1.cs","Line":6,"Column":18,"EndLine":6,"EndColumn":27,"Text":"The predefined type 'System.Object' is neither defined nor imported","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0518","FileName":"C:\\testomni\\UnitTest1.cs","Line":9,"Column":16,"EndLine":9,"EndColumn":20,"Text":"The predefiend type 'System.Void' is neither defined nor imported","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0518","FileName":"C:\\testomni\\UnitTest1.cs","Line":8,"Column":10,"EndLine":8,"EndColumn":20,"Text":"The predefined type 'System.Object' is neither defined nor imported","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0616","FileName":"C:\\testomni\\UnitTest1.cs","Line":8,"Column":10,"EndLine":8,"EndColumn":20,"Text":"'TestMethodAttribute' is not an attribute class","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0518","FileName":"C:\\testomni\\UnitTest1.cs","Line":8,"Column":10,"EndLine":8,"EndColumn":20,"Text":"The predefiend type 'System.Void' is neither defined nor imported","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS1729","FileName":"C:\\testomni\\UnitTest1.cs","Line":6,"Column":18,"EndLine":6,"EndColumn":27,"Text":"'object' does not contain a constructor that takes 0 arguments","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0433","FileName":"C:\\Temp\\.NETCoreApp,Version=v2.1.AssemblyAttributes.cs","Line":4,"Column":46,"EndLine":4,"EndColumn":70,"Text":"The type 'TargetFrameworkAttribute' exists in 'System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and in 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0518","FileName":"C:\\Temp\\.NETCoreApp,Version=v2.1.AssemblyAttributes.cs","Line":4,"Column":71,"EndLine":4,"EndColumn":97,"Text":"The predefiend type 'System.String' is neither defined nor imported","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0246","FileName":"C:\\Temp\\.NETCoreApp,Version=v2.1.AssemblyAttributes.cs","Line":4,"Column":99,"EndLine":4,"EndColumn":119,"Text":"The name of the type or namespace 'FrameworkDisplayName' was not found (¿missing an using directive or assembly reference?)","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0518","FileName":"C:\\Temp\\.NETCoreApp,Version=v2.1.AssemblyAttributes.cs","Line":4,"Column":122,"EndLine":4,"EndColumn":124,"Text":"The prefedined type 'System.String' was not defined nor imported","Projects":["testomni"]},{"LogLevel":"Hidden","Id":"CS8019","FileName":"C:\\Temp\\.NETCoreApp,Version=v2.1.AssemblyAttributes.cs","Line":3,"Column":1,"EndLine":3,"EndColumn":25,"Text":"Unnecessary Using directive.","Projects":["testomni"]},{"LogLevel":"Hidden","Id":"CS8019","FileName":"C:\\Temp\\.NETCoreApp,Version=v2.1.AssemblyAttributes.cs","Line":2,"Column":1,"EndLine":2,"EndColumn":14,"Text":"Unnecesary Using directive.","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0518","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.Program.cs","Line":3,"Column":2,"EndLine":3,"EndColumn":11,"Text":"The predefined type 'System.Object' is neither defined nor imported","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0616","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.Program.cs","Line":3,"Column":38,"EndLine":3,"EndColumn":62,"Text":"'TestSDKAutoGeneratedCode' is not an attribute class","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0518","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.Program.cs","Line":3,"Column":2,"EndLine":3,"EndColumn":62,"Text":"The predefined type 'System.Void' is neither defined nor imported","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0518","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.Program.cs","Line":4,"Column":7,"EndLine":4,"EndColumn":27,"Text":"The predefined type 'System.Object' is neither defined nor imported","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0518","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.Program.cs","Line":4,"Column":46,"EndLine":4,"EndColumn":52,"Text":"The predefined type 'System.String' is neither defined nor imported","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0518","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.Program.cs","Line":4,"Column":36,"EndLine":4,"EndColumn":40,"Text":"The predefined type 'System.Void' is neither defined nor imported","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS1729","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.Program.cs","Line":4,"Column":7,"EndLine":4,"EndColumn":27,"Text":"'object' does not contain a constructor that takes 0 arguments","Projects":["testomni"]},{"LogLevel":"Hidden","Id":"CS8019","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.Program.cs","Line":2,"Column":1,"EndLine":2,"EndColumn":14,"Text":"Unnecessary Using directive.","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0433","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.AssemblyInfo.cs","Line":14,"Column":30,"EndLine":14,"EndColumn":54,"Text":"The type 'AssemblyCompanyAttribute' exists in 'System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and in 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0433","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.AssemblyInfo.cs","Line":15,"Column":30,"EndLine":15,"EndColumn":60,"Text":"The type 'AssemblyConfigurationAttribute' exists in 'System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and in 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0433","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.AssemblyInfo.cs","Line":16,"Column":30,"EndLine":16,"EndColumn":58,"Text":"The type 'AssemblyFileVersionAttribute' exists in 'System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and in 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0433","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.AssemblyInfo.cs","Line":17,"Column":30,"EndLine":17,"EndColumn":67,"Text":"El tipo 'AssemblyInformationalVersionAttribute' existe en 'System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' y en 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0433","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.AssemblyInfo.cs","Line":18,"Column":30,"EndLine":18,"EndColumn":54,"Text":"El tipo 'AssemblyProductAttribute' existe en 'System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' y en 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0433","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.AssemblyInfo.cs","Line":19,"Column":30,"EndLine":19,"EndColumn":52,"Text":"El tipo 'AssemblyTitleAttribute' existe en 'System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' y en 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0433","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.AssemblyInfo.cs","Line":20,"Column":30,"EndLine":20,"EndColumn":54,"Text":"El tipo 'AssemblyVersionAttribute' existe en 'System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' y en 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0518","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.AssemblyInfo.cs","Line":14,"Column":55,"EndLine":14,"EndColumn":65,"Text":"El tipo predefinido 'System.String' no está definido ni importado","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0518","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.AssemblyInfo.cs","Line":15,"Column":61,"EndLine":15,"EndColumn":68,"Text":"El tipo predefinido 'System.String' no está definido ni importado","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0518","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.AssemblyInfo.cs","Line":16,"Column":59,"EndLine":16,"EndColumn":68,"Text":"El tipo predefinido 'System.String' no está definido ni importado","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0518","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.AssemblyInfo.cs","Line":17,"Column":68,"EndLine":17,"EndColumn":75,"Text":"El tipo predefinido 'System.String' no está definido ni importado","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0518","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.AssemblyInfo.cs","Line":18,"Column":55,"EndLine":18,"EndColumn":65,"Text":"El tipo predefinido 'System.String' no está definido ni importado","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0518","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.AssemblyInfo.cs","Line":19,"Column":53,"EndLine":19,"EndColumn":63,"Text":"El tipo predefinido 'System.String' no está definido ni importado","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0518","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.AssemblyInfo.cs","Line":20,"Column":55,"EndLine":20,"EndColumn":64,"Text":"El tipo predefinido 'System.String' no está definido ni importado","Projects":["testomni"]},{"LogLevel":"Hidden","Id":"CS8019","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.AssemblyInfo.cs","Line":11,"Column":1,"EndLine":11,"EndColumn":14,"Text":"Directiva Using innecesaria.","Projects":["testomni"]},{"LogLevel":"Hidden","Id":"CS8019","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.AssemblyInfo.cs","Line":12,"Column":1,"EndLine":12,"EndColumn":25,"Text":"Directiva Using innecesaria.","Projects":["testomni"]}]},"Seq":23,"Type":"response"}

@DustinCampbell
Copy link
Contributor

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).

@ramon-garcia
Copy link
Author

Thanks for the suggestion.

Updated VS 2017 Expess to 15.8.4, and still failing

C:\Users\ramon\.vscode\extensions\ms-vscode.csharp-1.16.1\.omnisharp\1.32.5\OmniSharp.exe -stdio
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Stdio.Host","Message":"Starting OmniSharp on Windows 6.2.9200.0 (x64)"},"Seq":1,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Services.DotNetCliService","Message":"DotNetPath set to dotnet"},"Seq":2,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.MSBuild.Discovery.MSBuildLocator","Message":"Located 2 MSBuild instance(s)\r\n            1: Visual Studio 2017 Express para escritorio 15.8.28010.2026 - \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\WDExpress\\MSBuild\\15.0\\Bin\"\r\n            2: StandAlone 15.0 - \"C:\\Users\\ramon\\.vscode\\extensions\\ms-vscode.csharp-1.16.1\\.omnisharp\\1.32.5\\msbuild\\15.0\\Bin\""},"Seq":3,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.MSBuild.Discovery.MSBuildLocator","Message":"Registered MSBuild instance: Visual Studio 2017 Express para escritorio 15.8.28010.2026 - \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\WDExpress\\MSBuild\\15.0\\Bin\""},"Seq":4,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Cake.CakeProjectSystem","Message":"Detecting Cake files in 'C:\\testomni'."},"Seq":5,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Cake.CakeProjectSystem","Message":"Could not find any Cake files"},"Seq":6,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.WorkspaceInitializer","Message":"Project system 'OmniSharp.DotNet.DotNetProjectSystem' is disabled in the configuration."},"Seq":7,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.MSBuild.ProjectSystem","Message":"No solution files found in 'C:\\testomni'"},"Seq":8,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.MSBuild.ProjectManager","Message":"Queue project update for 'C:\\testomni\\testomni.csproj'"},"Seq":9,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Script.ScriptProjectSystem","Message":"Detecting CSX files in 'C:\\testomni'."},"Seq":10,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Script.ScriptProjectSystem","Message":"Could not find any CSX files"},"Seq":11,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.WorkspaceInitializer","Message":"Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpWorkspaceOptionsProvider"},"Seq":12,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.WorkspaceInitializer","Message":"Configuration finished."},"Seq":13,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Stdio.Host","Message":"Omnisharp server running using Stdio at location 'C:\\testomni' on host -1."},"Seq":14,"Type":"event"}
{"Event":"started","Body":null,"Seq":15,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.MSBuild.ProjectManager","Message":"Loading project: C:\\testomni\\testomni.csproj"},"Seq":16,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.MSBuild.ProjectManager","Message":"Successfully loaded project file 'C:\\testomni\\testomni.csproj'."},"Seq":17,"Type":"event"}
{"Event":"MsBuildProjectDiagnostics","Body":{"FileName":"C:\\testomni\\testomni.csproj","Warnings":[],"Errors":[]},"Seq":18,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.MSBuild.ProjectManager","Message":"Adding project 'C:\\testomni\\testomni.csproj'"},"Seq":19,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.MSBuild.ProjectManager","Message":"Update project: testomni"},"Seq":20,"Type":"event"}
{"Event":"ProjectAdded","Body":{"MsBuildProject":{"ProjectGuid":"00000000-0000-0000-0000-000000000000","Path":"C:\\testomni\\testomni.csproj","AssemblyName":"testomni","TargetPath":"C:\\testomni\\bin\\Debug\\netcoreapp2.1\\testomni.dll","TargetFramework":".NETCoreApp,Version=v2.1","SourceFiles":["C:\\testomni\\UnitTest1.cs","C:\\Temp\\.NETCoreApp,Version=v2.1.AssemblyAttributes.cs","C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.Program.cs","C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.AssemblyInfo.cs"],"TargetFrameworks":[{"Name":".NETCoreApp","FriendlyName":".NETCoreApp","ShortName":"netcoreapp2.1"}],"OutputPath":"bin\\Debug\\netcoreapp2.1\\","IntermediateOutputPath":"obj\\Debug\\netcoreapp2.1\\","Configuration":"Debug","Platform":"AnyCPU","IsExe":true,"IsUnityProject":false}},"Seq":21,"Type":"event"}
{"Event":"ProjectChanged","Body":{"MsBuildProject":{"ProjectGuid":"00000000-0000-0000-0000-000000000000","Path":"C:\\testomni\\testomni.csproj","AssemblyName":"testomni","TargetPath":"C:\\testomni\\bin\\Debug\\netcoreapp2.1\\testomni.dll","TargetFramework":".NETCoreApp,Version=v2.1","SourceFiles":["C:\\testomni\\UnitTest1.cs","C:\\Temp\\.NETCoreApp,Version=v2.1.AssemblyAttributes.cs","C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.Program.cs","C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.AssemblyInfo.cs"],"TargetFrameworks":[{"Name":".NETCoreApp","FriendlyName":".NETCoreApp","ShortName":"netcoreapp2.1"}],"OutputPath":"bin\\Debug\\netcoreapp2.1\\","IntermediateOutputPath":"obj\\Debug\\netcoreapp2.1\\","Configuration":"Debug","Platform":"AnyCPU","IsExe":true,"IsUnityProject":false}},"Seq":22,"Type":"event"}
{"seq": 1, "Command": "/codecheck"}
{"Request_seq":1,"Command":"/codecheck","Running":true,"Success":true,"Message":null,"Body":{"QuickFixes":[{"LogLevel":"Error","Id":"CS0518","FileName":"C:\\testomni\\UnitTest1.cs","Line":5,"Column":6,"EndLine":5,"EndColumn":15,"Text":"El tipo predefinido 'System.Object' no está definido ni importado","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0616","FileName":"C:\\testomni\\UnitTest1.cs","Line":5,"Column":6,"EndLine":5,"EndColumn":15,"Text":"'TestClassAttribute' no es una clase de atributos","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0518","FileName":"C:\\testomni\\UnitTest1.cs","Line":5,"Column":6,"EndLine":5,"EndColumn":15,"Text":"El tipo predefinido 'System.Void' no está definido ni importado","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0518","FileName":"C:\\testomni\\UnitTest1.cs","Line":6,"Column":18,"EndLine":6,"EndColumn":27,"Text":"El tipo predefinido 'System.Object' no está definido ni importado","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0518","FileName":"C:\\testomni\\UnitTest1.cs","Line":9,"Column":16,"EndLine":9,"EndColumn":20,"Text":"El tipo predefinido 'System.Void' no está definido ni importado","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0518","FileName":"C:\\testomni\\UnitTest1.cs","Line":8,"Column":10,"EndLine":8,"EndColumn":20,"Text":"El tipo predefinido 'System.Object' no está definido ni importado","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0616","FileName":"C:\\testomni\\UnitTest1.cs","Line":8,"Column":10,"EndLine":8,"EndColumn":20,"Text":"'TestMethodAttribute' no es una clase de atributos","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0518","FileName":"C:\\testomni\\UnitTest1.cs","Line":8,"Column":10,"EndLine":8,"EndColumn":20,"Text":"El tipo predefinido 'System.Void' no está definido ni importado","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS1729","FileName":"C:\\testomni\\UnitTest1.cs","Line":6,"Column":18,"EndLine":6,"EndColumn":27,"Text":"'object' no contiene un constructor que tome 0 argumentos","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0433","FileName":"C:\\Temp\\.NETCoreApp,Version=v2.1.AssemblyAttributes.cs","Line":4,"Column":46,"EndLine":4,"EndColumn":70,"Text":"El tipo 'TargetFrameworkAttribute' existe en 'System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' y en 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0518","FileName":"C:\\Temp\\.NETCoreApp,Version=v2.1.AssemblyAttributes.cs","Line":4,"Column":71,"EndLine":4,"EndColumn":97,"Text":"El tipo predefinido 'System.String' no está definido ni importado","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0246","FileName":"C:\\Temp\\.NETCoreApp,Version=v2.1.AssemblyAttributes.cs","Line":4,"Column":99,"EndLine":4,"EndColumn":119,"Text":"El nombre del tipo o del espacio de nombres 'FrameworkDisplayName' no se encontró (¿falta una directiva using o una referencia de ensamblado?)","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0518","FileName":"C:\\Temp\\.NETCoreApp,Version=v2.1.AssemblyAttributes.cs","Line":4,"Column":122,"EndLine":4,"EndColumn":124,"Text":"El tipo predefinido 'System.String' no está definido ni importado","Projects":["testomni"]},{"LogLevel":"Hidden","Id":"CS8019","FileName":"C:\\Temp\\.NETCoreApp,Version=v2.1.AssemblyAttributes.cs","Line":2,"Column":1,"EndLine":2,"EndColumn":14,"Text":"Directiva Using innecesaria.","Projects":["testomni"]},{"LogLevel":"Hidden","Id":"CS8019","FileName":"C:\\Temp\\.NETCoreApp,Version=v2.1.AssemblyAttributes.cs","Line":3,"Column":1,"EndLine":3,"EndColumn":25,"Text":"Directiva Using innecesaria.","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0518","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.Program.cs","Line":3,"Column":2,"EndLine":3,"EndColumn":11,"Text":"El tipo predefinido 'System.Object' no está definido ni importado","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0616","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.Program.cs","Line":3,"Column":38,"EndLine":3,"EndColumn":62,"Text":"'TestSDKAutoGeneratedCode' no es una clase de atributos","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0518","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.Program.cs","Line":3,"Column":2,"EndLine":3,"EndColumn":62,"Text":"El tipo predefinido 'System.Void' no está definido ni importado","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0518","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.Program.cs","Line":4,"Column":7,"EndLine":4,"EndColumn":27,"Text":"El tipo predefinido 'System.Object' no está definido ni importado","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0518","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.Program.cs","Line":4,"Column":46,"EndLine":4,"EndColumn":52,"Text":"El tipo predefinido 'System.String' no está definido ni importado","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0518","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.Program.cs","Line":4,"Column":36,"EndLine":4,"EndColumn":40,"Text":"El tipo predefinido 'System.Void' no está definido ni importado","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS1729","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.Program.cs","Line":4,"Column":7,"EndLine":4,"EndColumn":27,"Text":"'object' no contiene un constructor que tome 0 argumentos","Projects":["testomni"]},{"LogLevel":"Hidden","Id":"CS8019","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.Program.cs","Line":2,"Column":1,"EndLine":2,"EndColumn":14,"Text":"Directiva Using innecesaria.","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0433","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.AssemblyInfo.cs","Line":14,"Column":30,"EndLine":14,"EndColumn":54,"Text":"El tipo 'AssemblyCompanyAttribute' existe en 'System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' y en 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0433","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.AssemblyInfo.cs","Line":15,"Column":30,"EndLine":15,"EndColumn":60,"Text":"El tipo 'AssemblyConfigurationAttribute' existe en 'System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' y en 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0433","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.AssemblyInfo.cs","Line":16,"Column":30,"EndLine":16,"EndColumn":58,"Text":"El tipo 'AssemblyFileVersionAttribute' existe en 'System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' y en 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0433","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.AssemblyInfo.cs","Line":17,"Column":30,"EndLine":17,"EndColumn":67,"Text":"El tipo 'AssemblyInformationalVersionAttribute' existe en 'System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' y en 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0433","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.AssemblyInfo.cs","Line":18,"Column":30,"EndLine":18,"EndColumn":54,"Text":"El tipo 'AssemblyProductAttribute' existe en 'System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' y en 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0433","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.AssemblyInfo.cs","Line":19,"Column":30,"EndLine":19,"EndColumn":52,"Text":"El tipo 'AssemblyTitleAttribute' existe en 'System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' y en 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0433","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.AssemblyInfo.cs","Line":20,"Column":30,"EndLine":20,"EndColumn":54,"Text":"El tipo 'AssemblyVersionAttribute' existe en 'System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' y en 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0518","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.AssemblyInfo.cs","Line":14,"Column":55,"EndLine":14,"EndColumn":65,"Text":"El tipo predefinido 'System.String' no está definido ni importado","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0518","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.AssemblyInfo.cs","Line":15,"Column":61,"EndLine":15,"EndColumn":68,"Text":"El tipo predefinido 'System.String' no está definido ni importado","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0518","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.AssemblyInfo.cs","Line":16,"Column":59,"EndLine":16,"EndColumn":68,"Text":"El tipo predefinido 'System.String' no está definido ni importado","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0518","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.AssemblyInfo.cs","Line":17,"Column":68,"EndLine":17,"EndColumn":75,"Text":"El tipo predefinido 'System.String' no está definido ni importado","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0518","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.AssemblyInfo.cs","Line":18,"Column":55,"EndLine":18,"EndColumn":65,"Text":"El tipo predefinido 'System.String' no está definido ni importado","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0518","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.AssemblyInfo.cs","Line":19,"Column":53,"EndLine":19,"EndColumn":63,"Text":"El tipo predefinido 'System.String' no está definido ni importado","Projects":["testomni"]},{"LogLevel":"Error","Id":"CS0518","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.AssemblyInfo.cs","Line":20,"Column":55,"EndLine":20,"EndColumn":64,"Text":"El tipo predefinido 'System.String' no está definido ni importado","Projects":["testomni"]},{"LogLevel":"Hidden","Id":"CS8019","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.AssemblyInfo.cs","Line":11,"Column":1,"EndLine":11,"EndColumn":14,"Text":"Directiva Using innecesaria.","Projects":["testomni"]},{"LogLevel":"Hidden","Id":"CS8019","FileName":"C:\\testomni\\obj\\Debug\\netcoreapp2.1\\testomni.AssemblyInfo.cs","Line":12,"Column":1,"EndLine":12,"EndColumn":25,"Text":"Directiva Using innecesaria.","Projects":["testomni"]}]},"Seq":23,"Type":"response"}

@DustinCampbell
Copy link
Contributor

Hmmm.... Any chance you could share the project?

@ramon-garcia
Copy link
Author

It is a trivial project created with "dotnet new mstest"

@HughGrovesArup
Copy link

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

.NET Core SDK (reflecting any global.json):
 Version:   2.2.102
 Commit:    96ff75a873

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.17134
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\2.2.102\

Host (useful for support):
  Version: 2.2.1
  Commit:  878dd11e62

.NET Core SDKs installed:
  1.1.11 [C:\Program Files\dotnet\sdk]
  2.2.102 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.2.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.2.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 1.0.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 1.1.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

Output from omnisharp log

Starting OmniSharp server at 22/04/2019, 14:08:46
    Target: c:\Users\Hugh.Groves\Documents\VS Code Projects\unit-testing-using-mstest\unit-testing-using-mstest.sln

OmniSharp server started.
    Path: C:\Users\Hugh.Groves\.vscode\extensions\ms-vscode.csharp-1.19.0\.omnisharp\1.32.18\OmniSharp.exe
    PID: 512

[info]: OmniSharp.Stdio.Host
        Starting OmniSharp on Windows 6.2.9200.0 (x64)
[info]: OmniSharp.Services.DotNetCliService
        DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 2 MSBuild instance(s)
            1: Visual Studio 2017 Desktop Express 15.9.28307.280 - "C:\Program Files (x86)\Microsoft Visual Studio\2017\WDExpress\MSBuild\15.0\Bin"
            2: StandAlone 15.0 - "C:\Users\Hugh.Groves\.vscode\extensions\ms-vscode.csharp-1.19.0\.omnisharp\1.32.18\.msbuild\Current\Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: Visual Studio 2017 Desktop Express 15.9.28307.280 - "C:\Program Files (x86)\Microsoft Visual Studio\2017\WDExpress\MSBuild\15.0\Bin"
[info]: OmniSharp.Cake.CakeProjectSystem
        Detecting Cake files in 'c:\Users\Hugh.Groves\Documents\VS Code Projects\unit-testing-using-mstest'.
[info]: OmniSharp.Cake.CakeProjectSystem
        Could not find any Cake files
[info]: OmniSharp.WorkspaceInitializer
        Project system 'OmniSharp.DotNet.DotNetProjectSystem' is disabled in the configuration.
[info]: OmniSharp.MSBuild.ProjectSystem
        Detecting projects in 'c:\Users\Hugh.Groves\Documents\VS Code Projects\unit-testing-using-mstest\unit-testing-using-mstest.sln'.
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for 'c:\Users\Hugh.Groves\Documents\VS Code Projects\unit-testing-using-mstest\PrimeService\PrimeService.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for 'c:\Users\Hugh.Groves\Documents\VS Code Projects\unit-testing-using-mstest\PrimeService.Tests\PrimeService.Tests.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in 'c:\Users\Hugh.Groves\Documents\VS Code Projects\unit-testing-using-mstest'.
[info]: OmniSharp.Script.ScriptProjectSystem
        Could not find any CSX files
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpWorkspaceOptionsProvider
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: c:\Users\Hugh.Groves\Documents\VS Code Projects\unit-testing-using-mstest\PrimeService\PrimeService.csproj
[info]: OmniSharp.WorkspaceInitializer
        Configuration finished.
[info]: OmniSharp.Stdio.Host
        Omnisharp server running using Stdio at location 'c:\Users\Hugh.Groves\Documents\VS Code Projects\unit-testing-using-mstest' on host 18792.
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file 'c:\Users\Hugh.Groves\Documents\VS Code Projects\unit-testing-using-mstest\PrimeService\PrimeService.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project 'c:\Users\Hugh.Groves\Documents\VS Code Projects\unit-testing-using-mstest\PrimeService\PrimeService.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: c:\Users\Hugh.Groves\Documents\VS Code Projects\unit-testing-using-mstest\PrimeService.Tests\PrimeService.Tests.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file 'c:\Users\Hugh.Groves\Documents\VS Code Projects\unit-testing-using-mstest\PrimeService.Tests\PrimeService.Tests.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project 'c:\Users\Hugh.Groves\Documents\VS Code Projects\unit-testing-using-mstest\PrimeService.Tests\PrimeService.Tests.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: PrimeService
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: PrimeService.Tests

@niketgosrani
Copy link

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

//------------------------------------------------------------------------------
//
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//
//------------------------------------------------------------------------------

using System;
using System.Reflection;

[assembly: System.Reflection.AssemblyCompanyAttribute("GradeBook.Tests")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyProductAttribute("GradeBook.Tests")]
[assembly: System.Reflection.AssemblyTitleAttribute("GradeBook.Tests")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

// Generated by the MSBuild WriteCodeFragment class.

***The one's in bold are all showing errors

@HughGrovesArup
Copy link

@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?

@HughGrovesArup
Copy link

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.

dotnet/vscode-csharp#1727

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

No branches or pull requests

4 participants