While trying out the new ASP.NET Core gRPC features in Visual Studio Code I noticed that I'm getting errors in the OmniSharp Log in VS Code after adding the Protobuf element to my project file. Interestingly this only seems to fail for the client project and not for the server project. I've followed the documentation to ge the client going. But once I add the
[warn]: OmniSharp.MSBuild.ProjectManager
Failed to load project file '/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj'.
/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj
/root/.nuget/packages/grpc.tools/1.20.1/build/_protobuf/Google.Protobuf.Tools.targets(263,5): Error: The "ProtoCompile" task failed unexpectedly.
System.MissingMethodException: Method not found: void Microsoft.Build.Utilities.ToolTask.set_UseCommandProcessor(bool)
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00029] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask (Microsoft.Build.BackEnd.ITaskExecutionHost taskExecutionHost, Microsoft.Build.BackEnd.Logging.TaskLoggingContext taskLoggingContext, Microsoft.Build.BackEnd.TaskHost taskHost, Microsoft.Build.BackEnd.ItemBucket bucket, Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask) [0x00212] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0
Which version of OmniSharp are you using?
Also, can you post the full output of the OmniSharp log? thanks!
@filipw Sure thing. I'm running omnisharp 1.32.18 according to the logs, as part of the VS Code C# extension version 1.19.0. Here are the logs:
Starting OmniSharp server at 2019-5-7 12:50:56
Target: /workspaces/aspnetcore-grpc/aspnetcore-grpc.sln
OmniSharp server started.
Path: /root/.vscode-remote/extensions/ms-vscode.csharp-1.19.0/.omnisharp/1.32.18/run
PID: 977
[info]: OmniSharp.Stdio.Host
Starting OmniSharp on debian 0.0 (x64)
[info]: OmniSharp.Services.DotNetCliService
DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 1 MSBuild instance(s)
1: StandAlone 15.0 - "/root/.vscode-remote/extensions/ms-vscode.csharp-1.19.0/.omnisharp/1.32.18/omnisharp/.msbuild/Current/Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
MSBUILD_EXE_PATH environment variable set to '/root/.vscode-remote/extensions/ms-vscode.csharp-1.19.0/.omnisharp/1.32.18/omnisharp/.msbuild/Current/Bin/MSBuild.dll'
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: StandAlone 15.0 - "/root/.vscode-remote/extensions/ms-vscode.csharp-1.19.0/.omnisharp/1.32.18/omnisharp/.msbuild/Current/Bin"
MSBuildExtensionsPath = /root/.vscode-remote/extensions/ms-vscode.csharp-1.19.0/.omnisharp/1.32.18/omnisharp/.msbuild
BypassFrameworkInstallChecks = true
CscToolPath = /root/.vscode-remote/extensions/ms-vscode.csharp-1.19.0/.omnisharp/1.32.18/omnisharp/.msbuild/Current/Bin/Roslyn
CscToolExe = csc.exe
MSBuildToolsPath = /root/.vscode-remote/extensions/ms-vscode.csharp-1.19.0/.omnisharp/1.32.18/omnisharp/.msbuild/Current/Bin
[info]: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in '/workspaces/aspnetcore-grpc'.
[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 '/workspaces/aspnetcore-grpc/aspnetcore-grpc.sln'.
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/workspaces/aspnetcore-grpc/Service/AspNetCoreGRPC.Service.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in '/workspaces/aspnetcore-grpc'.
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: /workspaces/aspnetcore-grpc/Service/AspNetCoreGRPC.Service.csproj
[info]: OmniSharp.Script.ScriptProjectSystem
Could not find any CSX files
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpWorkspaceOptionsProvider
[info]: OmniSharp.WorkspaceInitializer
Configuration finished.
[info]: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location '/workspaces/aspnetcore-grpc' on host 125.
[info]: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file '/workspaces/aspnetcore-grpc/Service/AspNetCoreGRPC.Service.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
Adding project '/workspaces/aspnetcore-grpc/Service/AspNetCoreGRPC.Service.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: /workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj
[info]: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file '/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
Adding project '/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Update project: AspNetCoreGRPC.Service
[info]: OmniSharp.MSBuild.ProjectManager
Update project: AspNetCoreGRPC.Client
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: /workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file '/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
Update project: AspNetCoreGRPC.Client
[warn]: OmniSharp.MSBuild.PackageDependencyChecker
AspNetCoreGRPC.Client: Did not find 'Microsoft.NETCore.Platforms' in lock file.
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: /workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file '/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
Update project: AspNetCoreGRPC.Client
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: /workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file '/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
Update project: AspNetCoreGRPC.Client
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: /workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj
[fail]: OmniSharp.MSBuild.ProjectLoader
The "ProtoCompile" task failed unexpectedly.
System.MissingMethodException: Method not found: void Microsoft.Build.Utilities.ToolTask.set_UseCommandProcessor(bool)
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00029] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask (Microsoft.Build.BackEnd.ITaskExecutionHost taskExecutionHost, Microsoft.Build.BackEnd.Logging.TaskLoggingContext taskLoggingContext, Microsoft.Build.BackEnd.TaskHost taskHost, Microsoft.Build.BackEnd.ItemBucket bucket, Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask) [0x00212] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0
[warn]: OmniSharp.MSBuild.ProjectManager
Failed to load project file '/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj'.
/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj
/root/.nuget/packages/grpc.tools/1.20.1/build/_protobuf/Google.Protobuf.Tools.targets(263,5): Error: The "ProtoCompile" task failed unexpectedly.
System.MissingMethodException: Method not found: void Microsoft.Build.Utilities.ToolTask.set_UseCommandProcessor(bool)
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00029] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask (Microsoft.Build.BackEnd.ITaskExecutionHost taskExecutionHost, Microsoft.Build.BackEnd.Logging.TaskLoggingContext taskLoggingContext, Microsoft.Build.BackEnd.TaskHost taskHost, Microsoft.Build.BackEnd.ItemBucket bucket, Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask) [0x00212] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0
[info]: OmniSharp.MSBuild.ProjectManager
Update project: AspNetCoreGRPC.Client
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: /workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj
[fail]: OmniSharp.MSBuild.ProjectLoader
The "ProtoCompile" task failed unexpectedly.
System.MissingMethodException: Method not found: void Microsoft.Build.Utilities.ToolTask.set_UseCommandProcessor(bool)
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00029] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask (Microsoft.Build.BackEnd.ITaskExecutionHost taskExecutionHost, Microsoft.Build.BackEnd.Logging.TaskLoggingContext taskLoggingContext, Microsoft.Build.BackEnd.TaskHost taskHost, Microsoft.Build.BackEnd.ItemBucket bucket, Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask) [0x00212] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0
[warn]: OmniSharp.MSBuild.ProjectManager
Failed to load project file '/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj'.
/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj
/root/.nuget/packages/grpc.tools/1.20.1/build/_protobuf/Google.Protobuf.Tools.targets(263,5): Error: The "ProtoCompile" task failed unexpectedly.
System.MissingMethodException: Method not found: void Microsoft.Build.Utilities.ToolTask.set_UseCommandProcessor(bool)
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00029] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask (Microsoft.Build.BackEnd.ITaskExecutionHost taskExecutionHost, Microsoft.Build.BackEnd.Logging.TaskLoggingContext taskLoggingContext, Microsoft.Build.BackEnd.TaskHost taskHost, Microsoft.Build.BackEnd.ItemBucket bucket, Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask) [0x00212] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0
[info]: OmniSharp.MSBuild.ProjectManager
Update project: AspNetCoreGRPC.Client
[info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService
Applying code action: using Grpc.Core;
[info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService
Applying code action: using Greet;
[info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService
Applying code action: using System.Threading.Tasks;
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: /workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj'
[fail]: OmniSharp.MSBuild.ProjectLoader
The "ProtoCompile" task failed unexpectedly.
System.MissingMethodException: Method not found: void Microsoft.Build.Utilities.ToolTask.set_UseCommandProcessor(bool)
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00029] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask (Microsoft.Build.BackEnd.ITaskExecutionHost taskExecutionHost, Microsoft.Build.BackEnd.Logging.TaskLoggingContext taskLoggingContext, Microsoft.Build.BackEnd.TaskHost taskHost, Microsoft.Build.BackEnd.ItemBucket bucket, Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask) [0x00212] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0
[warn]: OmniSharp.MSBuild.ProjectManager
Failed to load project file '/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj'.
/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj
/root/.nuget/packages/grpc.tools/1.20.1/build/_protobuf/Google.Protobuf.Tools.targets(263,5): Error: The "ProtoCompile" task failed unexpectedly.
System.MissingMethodException: Method not found: void Microsoft.Build.Utilities.ToolTask.set_UseCommandProcessor(bool)
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00029] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask (Microsoft.Build.BackEnd.ITaskExecutionHost taskExecutionHost, Microsoft.Build.BackEnd.Logging.TaskLoggingContext taskLoggingContext, Microsoft.Build.BackEnd.TaskHost taskHost, Microsoft.Build.BackEnd.ItemBucket bucket, Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask) [0x00212] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0
[info]: OmniSharp.MSBuild.ProjectManager
Update project: AspNetCoreGRPC.Client
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: /workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj
[info]: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file '/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
Update project: AspNetCoreGRPC.Client
[info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService
Applying code action: using Grpc.Core;
[info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService
Applying code action: using Greet;
[info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService
Applying code action: using System.Threading.Tasks;
[info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService
Applying code action: using BenchmarkDotNet.Running;
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: /workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj
[info]: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file '/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
Update project: AspNetCoreGRPC.Client
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: /workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj
[fail]: OmniSharp.MSBuild.ProjectLoader
The "ProtoCompile" task failed unexpectedly.
System.MissingMethodException: Method not found: void Microsoft.Build.Utilities.ToolTask.set_UseCommandProcessor(bool)
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00029] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask (Microsoft.Build.BackEnd.ITaskExecutionHost taskExecutionHost, Microsoft.Build.BackEnd.Logging.TaskLoggingContext taskLoggingContext, Microsoft.Build.BackEnd.TaskHost taskHost, Microsoft.Build.BackEnd.ItemBucket bucket, Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask) [0x00212] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0
[warn]: OmniSharp.MSBuild.ProjectManager
Failed to load project file '/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj'.
/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj
/root/.nuget/packages/grpc.tools/1.20.1/build/_protobuf/Google.Protobuf.Tools.targets(263,5): Error: The "ProtoCompile" task failed unexpectedly.
System.MissingMethodException: Method not found: void Microsoft.Build.Utilities.ToolTask.set_UseCommandProcessor(bool)
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00029] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask (Microsoft.Build.BackEnd.ITaskExecutionHost taskExecutionHost, Microsoft.Build.BackEnd.Logging.TaskLoggingContext taskLoggingContext, Microsoft.Build.BackEnd.TaskHost taskHost, Microsoft.Build.BackEnd.ItemBucket bucket, Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask) [0x00212] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0
[info]: OmniSharp.MSBuild.ProjectManager
Update project: AspNetCoreGRPC.Client
[info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService
Applying code action: using BenchmarkDotNet.Configs;
[info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService
Applying code action: using BenchmarkDotNet.Jobs;
[info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService
Applying code action: using BenchmarkDotNet.Toolchains.CsProj;
[info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService
Applying code action: using BenchmarkDotNet.Configs;
[info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService
Applying code action: using BenchmarkDotNet.Jobs;
[info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService
Applying code action: using BenchmarkDotNet.Toolchains.CsProj;
[info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService
Applying code action: Add argument name 'toolchain'
[info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService
Applying code action: using Microsoft.AspNetCore.Mvc;
[info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService
Applying code action: using System.Threading.Tasks;
[info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService
Applying code action: using Microsoft.AspNetCore.Server.Kestrel.Core;
[info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService
Applying code action: using System.Net.Http;
[info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService
Applying code action: using System;
[info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService
Applying code action: using Greet;
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: /workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj'
[fail]: OmniSharp.MSBuild.ProjectLoader
The "ProtoCompile" task failed unexpectedly.
System.MissingMethodException: Method not found: void Microsoft.Build.Utilities.ToolTask.set_UseCommandProcessor(bool)
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00029] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask (Microsoft.Build.BackEnd.ITaskExecutionHost taskExecutionHost, Microsoft.Build.BackEnd.Logging.TaskLoggingContext taskLoggingContext, Microsoft.Build.BackEnd.TaskHost taskHost, Microsoft.Build.BackEnd.ItemBucket bucket, Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask) [0x00212] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0
[warn]: OmniSharp.MSBuild.ProjectManager
Failed to load project file '/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj'.
/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj
/root/.nuget/packages/grpc.tools/1.20.1/build/_protobuf/Google.Protobuf.Tools.targets(263,5): Error: The "ProtoCompile" task failed unexpectedly.
System.MissingMethodException: Method not found: void Microsoft.Build.Utilities.ToolTask.set_UseCommandProcessor(bool)
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00029] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask (Microsoft.Build.BackEnd.ITaskExecutionHost taskExecutionHost, Microsoft.Build.BackEnd.Logging.TaskLoggingContext taskLoggingContext, Microsoft.Build.BackEnd.TaskHost taskHost, Microsoft.Build.BackEnd.ItemBucket bucket, Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask) [0x00212] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0
[info]: OmniSharp.MSBuild.ProjectManager
Update project: AspNetCoreGRPC.Client
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: /workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj
[info]: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file '/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
Update project: AspNetCoreGRPC.Client
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: /workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj
[fail]: OmniSharp.MSBuild.ProjectLoader
The "ProtoCompile" task failed unexpectedly.
System.MissingMethodException: Method not found: void Microsoft.Build.Utilities.ToolTask.set_UseCommandProcessor(bool)
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00029] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask (Microsoft.Build.BackEnd.ITaskExecutionHost taskExecutionHost, Microsoft.Build.BackEnd.Logging.TaskLoggingContext taskLoggingContext, Microsoft.Build.BackEnd.TaskHost taskHost, Microsoft.Build.BackEnd.ItemBucket bucket, Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask) [0x00212] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0
[warn]: OmniSharp.MSBuild.ProjectManager
Failed to load project file '/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj'.
/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj
/root/.nuget/packages/grpc.tools/1.20.1/build/_protobuf/Google.Protobuf.Tools.targets(263,5): Error: The "ProtoCompile" task failed unexpectedly.
System.MissingMethodException: Method not found: void Microsoft.Build.Utilities.ToolTask.set_UseCommandProcessor(bool)
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00029] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask (Microsoft.Build.BackEnd.ITaskExecutionHost taskExecutionHost, Microsoft.Build.BackEnd.Logging.TaskLoggingContext taskLoggingContext, Microsoft.Build.BackEnd.TaskHost taskHost, Microsoft.Build.BackEnd.ItemBucket bucket, Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask) [0x00212] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0
[info]: OmniSharp.MSBuild.ProjectManager
Update project: AspNetCoreGRPC.Client
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: /workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj
[fail]: OmniSharp.MSBuild.ProjectLoader
The "ProtoCompile" task failed unexpectedly.
System.MissingMethodException: Method not found: void Microsoft.Build.Utilities.ToolTask.set_UseCommandProcessor(bool)
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00029] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask (Microsoft.Build.BackEnd.ITaskExecutionHost taskExecutionHost, Microsoft.Build.BackEnd.Logging.TaskLoggingContext taskLoggingContext, Microsoft.Build.BackEnd.TaskHost taskHost, Microsoft.Build.BackEnd.ItemBucket bucket, Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask) [0x00212] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0
[warn]: OmniSharp.MSBuild.ProjectManager
Failed to load project file '/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj'.
/workspaces/aspnetcore-grpc/Client/AspNetCoreGRPC.Client.csproj
/root/.nuget/packages/grpc.tools/1.20.1/build/_protobuf/Google.Protobuf.Tools.targets(263,5): Error: The "ProtoCompile" task failed unexpectedly.
System.MissingMethodException: Method not found: void Microsoft.Build.Utilities.ToolTask.set_UseCommandProcessor(bool)
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00029] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask (Microsoft.Build.BackEnd.ITaskExecutionHost taskExecutionHost, Microsoft.Build.BackEnd.Logging.TaskLoggingContext taskLoggingContext, Microsoft.Build.BackEnd.TaskHost taskHost, Microsoft.Build.BackEnd.ItemBucket bucket, Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask) [0x00212] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0
[info]: OmniSharp.MSBuild.ProjectManager
Update project: AspNetCoreGRPC.Client
@filipw Do you need any additional info?
This is also happening with the OmniSharp on the latest C# Extension in Visual Studio Code on OSX.
/Users/mathewphillips/.nuget/packages/grpc.tools/1.22.0/build/_protobuf/Google.Protobuf.Tools.targets(264,5): Error: The "ProtoCompile" task failed unexpectedly.
System.MissingMethodException: Method not found: void
Microsoft.Build.Utilities.ToolTask.set_UseCommandProcessor(bool)
at
Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute ()
[0x00029] in <4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask
(Microsoft.Build.BackEnd.ITaskExecutionHost taskExecutionHost,
Microsoft.Build.BackEnd.Logging.TaskLoggingContext taskLoggingContext,
Microsoft.Build.BackEnd.TaskHost taskHost, Microsoft.Build.BackEnd.ItemBucket bucket,
Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask) [0x00212] in
<4e0a1f1d78cf4c1ebd6f9a3dbcebf3bb>:0
This issue also happens to me, but it just happens when I install "serilog" package
gRPC MSBuild tooling developer here. What happens is, with a near certainty, is the build tasks DLL from the package links at runtime to the wrong version of Microsoft.Build.Utilities, specifically the one that comes with Mono/XBuild rather than that from the Microsoft's MSBuild package. XBuild's MSBuild emulation assemblies notoriously lack some methods, so we're unlikely runnable against them.
Do you think it's possible to change this behavior within OmniSharp?
This is really annoying :/
I have lost my intellisense in VS Code since adding some Mono to my project. This really hurts productivity for me. It there no temporary workaround?
For anyone still experiencing this issue, I've found a workaround that works for me on OmniSharp for OSX, Version = 1.34.5. It would seem that the root cause of the issue was found, but the fix in #1595 does not help me.
So far, the only solution for me has been to remove Microsoft.Build.Tasks.v4.0 and Microsoft.Build.Utilities.v4.0 libraries from the Mono GAC in Omnisharp.
Following the steps below has fully restored Omnisharp functionality for me in VSCode gRPC/Protobuf projects:
~/.vscode/extensions/ms-vscode.csharp-1.21.5/.omnisharp/1.34.5.lib/mono/gac/ folder within the Omnisharp directory.Microsoft.Build.Tasks.v4.0 and Microsoft.Build.Utilities.v4.0 folders."omnisharp.useGlobalMono": "never", to your VSCode settings.json.This is a brutal way to solve the problem, but it's allowed me to get back to work.
@radical, since you worked on #1595, I'm wondering if my solution might give you more insight on how we can bypass the old MSBuild libraries.
The workaround suggested by @nagytech has worked for me as well, working on Ubuntu and with Omnisharp 1.34.5
the fix from #1595 has not been shipped yet because it was applied to the embedded mono build which hasn't been changed yet.
it will ship only once #1640 is merged
Thanks for the update @filipw.
I thought I would be able to build from master and that would solve the issue, but that doesn't seem to be the case. Is that correct?
Looks like #1640 has been merged and deployed on November 6 (1.21.7) but this problem persists for me.
Verified that I am using the right version of mono "OmniSharp server started with Mono 6.4.0." but receive the following in the log.
[fail]: OmniSharp.MSBuild.ProjectLoader
The "ProtoCompile" task failed unexpectedly.
System.MissingMethodException: Method not found: void Microsoft.Build.Utilities.ToolTask.set_UseCommandProcessor(bool)
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00029] in <10b73e4bf233421cae439ef765e97ef0>:0
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask (Microsoft.Build.BackEnd.ITaskExecutionHost taskExecutionHost, Microsoft.Build.BackEnd.Logging.TaskLoggingContext taskLoggingContext, Microsoft.Build.BackEnd.TaskHost taskHost, Microsoft.Build.BackEnd.ItemBucket bucket, Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask) [0x002a9] in <10b73e4bf233421cae439ef765e97ef0>:0
Yup same problem still here
OmniSharp server started with Mono 6.4.0.
Path: /Users/nils/.vscode/extensions/ms-vscode.csharp-1.21.8/.omnisharp/1.34.9-beta.24/omnisharp/OmniSharp.exe
PID: 9633
[info]: OmniSharp.Stdio.Host
Starting OmniSharp on MacOS 10.14.6 (x64)
[info]: OmniSharp.Services.DotNetCliService
DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 2 MSBuild instance(s)
1: Mono 16.3 - "/Library/Frameworks/Mono.framework/Versions/6.4.0/lib/mono/msbuild/Current/bin"
2: StandAlone 16.3 - "/Users/nils/.vscode/extensions/ms-vscode.csharp-1.21.8/.omnisharp/1.34.9-beta.24/omnisharp/.msbuild/Current/Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: Mono 16.3 - "/Library/Frameworks/Mono.framework/Versions/6.4.0/lib/mono/msbuild/Current/bin"
CscToolExe = csc.exe
CscToolPath = /Users/nils/.vscode/extensions/ms-vscode.csharp-1.21.8/.omnisharp/1.34.9-beta.24/omnisharp/.msbuild/Current/Bin/Roslyn
The "ProtoCompile" task failed unexpectedly.
System.MissingMethodException: Method not found: void Microsoft.Build.Utilities.ToolTask.set_UseCommandProcessor(bool)
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00029] in <4f09eee3b78a486b82b9150b91f40192>:0
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask (Microsoft.Build.BackEnd.ITaskExecutionHost taskExecutionHost, Microsoft.Build.BackEnd.Logging.TaskLoggingContext taskLoggingContext, Microsoft.Build.BackEnd.TaskHost taskHost, Microsoft.Build.BackEnd.ItemBucket bucket, Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask) [0x002a9] in <4f09eee3b78a486b82b9150b91f40192>:0
Following the steps below has fully restored Omnisharp functionality for me in VSCode gRPC/Protobuf projects:
- Find the path which leads to your Omnisharp extension. Example:
~/.vscode/extensions/ms-vscode.csharp-1.21.5/.omnisharp/1.34.5.- Open the
lib/mono/gac/folder within the Omnisharp directory.- Delete the
Microsoft.Build.Tasks.v4.0andMicrosoft.Build.Utilities.v4.0folders.- Add
"omnisharp.useGlobalMono": "never",to your VSCodesettings.json.- Restart Omnisharp.
This file structure is not present for me in the recent omnisharp releases
# nils @ elMaco in ~/.vscode/extensions/ms-vscode.csharp-1.21.8 [13:47:59]
$ find . | grep Microsoft.Build.Tasks.v4.0
./.omnisharp/1.34.8/omnisharp/.msbuild/Current/Bin/Microsoft.Build.Tasks.v4.0.dll
./.omnisharp/1.34.8/omnisharp/.msbuild/15.0/Bin/Microsoft.Build.Tasks.v4.0.dll
./.omnisharp/1.34.9-beta.24/omnisharp/.msbuild/Current/Bin/Microsoft.Build.Tasks.v4.0.dll
./.omnisharp/1.34.9-beta.24/omnisharp/.msbuild/15.0/Bin/Microsoft.Build.Tasks.v4.0.dll
./.omnisharp/1.34.9-beta.2/omnisharp/.msbuild/Current/Bin/Microsoft.Build.Tasks.v4.0.dll
./.omnisharp/1.34.9-beta.2/omnisharp/.msbuild/15.0/Bin/Microsoft.Build.Tasks.v4.0.dll
./.omnisharp/1.34.9-beta.10/omnisharp/.msbuild/Current/Bin/Microsoft.Build.Tasks.v4.0.dll
./.omnisharp/1.34.9-beta.10/omnisharp/.msbuild/15.0/Bin/Microsoft.Build.Tasks.v4.0.dll
However, setting the
"omnisharp.useGlobalMono": "never",
in settings.json seems to help!
I also deleted all previous omnisharp packages in ~/.vscode/extensions/ms-vscode.csharp-1.21.8/.omnisharp, not sure if this was part of the solution.
The fix was deployed and shipped however it only affects running on local (not global) Mono.
Therefore the setting "omnisharp.useGlobalMono": "never" is necessary to see the result. Alternatively, it also works if no Mono 6.4.0+ is found on the machine.
The fix was deployed and shipped however it only affects running on local (not global) Mono.
Therefore the setting"omnisharp.useGlobalMono": "never"is necessary to see the result. Alternatively, it also works if no Mono 6.4.0+ is found on the machine.
Unfortunately, this fix no longer helps. It produces different error:
Microsoft.Build.Exceptions.InvalidProjectFileException: The SDK 'Microsoft.NET.Sdk.Web' specified could not be found.
Most helpful comment
This is really annoying :/
I have lost my intellisense in VS Code since adding some Mono to my project. This really hurts productivity for me. It there no temporary workaround?