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

[BUG] Activating the "Microsoft.VisualStudio.ProjectSystem.Query.Remoting.QueryExecutionService (0.2)" service failed. #840

Closed
dibarbet opened this issue Jan 5, 2024 · 28 comments
Assignees
Labels
area-project Project load, Solution Explorer bug Something isn't working fixed high-priority triaged The issue has been triaged
Milestone

Comments

@dibarbet
Copy link
Member

dibarbet commented Jan 5, 2024

Describe the Issue

This is copied from a comment on dotnet/vscode-csharp#6777 (comment), originally posted by @dpoole73

I do see this error when opening code:

Activating the "Microsoft.VisualStudio.CpsProjectIconSourceService (0.1)" service failed.

I also see this in the C# Dev Kit - Test explorer log:

Created Test Controller
Using vstest from dotnet sdk in [/usr/local/share/dotnet/x64/sdk/8.0.100].
Initialized Test Explorer Server [67339]
Test Store Folder: /Users/dpoole/Library/Application Support/Code/User/workspaceStorage/0cb1155ccf7c948a51123cea767d1c2e/ms-dotnettools.csdevkit
Error opening test data: Failed to deserialize Microsoft.VisualStudio.TestWindow.Records.LogEntry value.
Test data was cleared upon opening.
Test data store opened in 0.001 sec.
Initialized project system provider.
Microsoft.ServiceHub.Framework.ServiceActivationFailedException: Activating the "Microsoft.VisualStudio.ProjectSystem.Query.Remoting.QueryExecutionService (0.2)" service failed.
 ---> StreamJsonRpc.RemoteInvocationException: Failed to start host 'dotnet.projectSystem$C94B8CFE-E3FD-4BAF-A941-2866DBB566FE'. Host exited with code '130' (ErrorKind: HostExited)
   at StreamJsonRpc.JsonRpc.InvokeCoreAsync[TResult](RequestId id, String targetName, IReadOnlyList`1 arguments, IReadOnlyList`1 positionalArgumentDeclaredTypes, IReadOnlyDictionary`2 namedArgumentDeclaredTypes, CancellationToken cancellationToken, Boolean isParameterObject)
   at Microsoft.ServiceHub.Framework.RemoteServiceBroker.GetProxyAsync[T](ServiceRpcDescriptor serviceDescriptor, ServiceActivationOptions options, CancellationToken cancellationToken)
RPC server exception:
StreamJsonRpc.RemoteInvocationException: Failed to start host 'dotnet.projectSystem$C94B8CFE-E3FD-4BAF-A941-2866DBB566FE'. Host exited with code '130' (ErrorKind: HostExited)
      at StreamJsonRpc.JsonRpc.InvokeCoreAsync[TResult](RequestId id, String targetName, IReadOnlyList`1 arguments, IReadOnlyList`1 positionalArgumentDeclaredTypes, IReadOnlyDictionary`2 namedArgumentDeclaredTypes, CancellationToken cancellationToken, Boolean isParameterObject)
      at Microsoft.ServiceHub.Client.HubClient.RemoteServiceBrokerWrapper.<>c__DisplayClass9_0.<<RequestServiceChannelAsync>b__0>d.MoveNext()
   --- End of stack trace from previous location ---
      at Microsoft.ServiceHub.Client.HubClient.RemoteServiceBrokerWrapper.<>c__DisplayClass9_0.<<RequestServiceChannelAsync>b__0>d.MoveNext()
   --- End of stack trace from previous location ---
      at Microsoft.ServiceHub.Utility.Shared.ServiceHubRetry.ExecuteAsync[TReturnType](Func`1 actionToExecute, TraceSource logger, ServiceHubRetryConfiguration`1 serviceHubRetryConfiguration, CancellationToken cancellationToken)
      at Microsoft.ServiceHub.Utility.Shared.ServiceHubRetry.ExecuteAsync[TReturnType](Func`1 actionToExecute, TraceSource logger, ServiceHubRetryConfiguration`1 serviceHubRetryConfiguration, CancellationToken cancellationToken)
      at Microsoft.ServiceHub.Client.HubClient.RemoteServiceBrokerWrapper.RequestServiceChannelAsync(ServiceMoniker serviceMoniker, ServiceActivationOptions options, CancellationToken cancellationToken)
      at Microsoft.ServiceHub.Client.HubClient.RemoteServiceBrokerWrapper.RequestServiceChannelAsync(ServiceMoniker serviceMoniker, ServiceActivationOptions options, CancellationToken cancellationToken)
      at Microsoft.VisualStudio.Utilities.ServiceBroker.GlobalBrokeredServiceContainer.View.RequestServiceChannelAsync(ServiceMoniker serviceMoniker, ServiceActivationOptions serviceActivationOptions, CancellationToken cancellationToken)

   --- End of inner exception stack trace ---
   at Microsoft.ServiceHub.Framework.RemoteServiceBroker.GetProxyAsync[T](ServiceRpcDescriptor serviceDescriptor, ServiceActivationOptions options, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.ProjectSystem.Query.Remoting.QueryClientExecutionEngine.GetExecutionServiceAsync(CancellationToken cancellationToken)
   at Microsoft.VisualStudio.ProjectSystem.Query.Remoting.QueryClientExecutionEngine.SubscribeAsync[TEntity](AsyncQueryable query, IObserver`1 resultsReceiver, IQueryExecutionRemoteContext remoteContext, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.TestWindow.VSCode.ProjectSystemProvider.Service.ProjectSystemProviderService.<InitializeAsync>b__8_0()
   at Microsoft.VisualStudio.TestWindow.Logging.ILoggerExtensions.CallWithCatchAsync(IInternalLogger log, Func`1 func)

Likely because there is no solution shown in the solution explorer is why the Language server is not working?

Steps To Reproduce

No response

Expected Behavior

No response

Environment Information

i'm seeing very similar issues. I'm running on MacBook with apple silicon using the x64 version of dotnet and setting DOTNET_ROOT

@dpoole73
Copy link

dpoole73 commented Jan 8, 2024

to clarify, the issue happens with or without specifying DOTNET_ROOT it happens on multiple repos as well. Let me know what logs I can share to help figure this out, this is really impacting my productivity

Copy link

github-actions bot commented Apr 3, 2024

This issue has been marked as stale after 14 days of inactivity. @[ @ @], could you please take a look?

@Michael-Eng Michael-Eng added this to the June2024 milestone Apr 29, 2024
@Michael-Eng
Copy link
Member

@lifengl Can you check to see if we've fixed this issue (or if it still repros?

@AppliedK
Copy link

AppliedK commented May 7, 2024

Same Issue. Activating the "Microsoft.VisualStudio.CpsProjectIconSourceService (0.1)" service failed.
I have reinstalled the extensions but the issue is not resolved.
VS Code Issue

@tophattwaffle
Copy link

I am also having this issue now on a Unity project. Was fine yesterday.

If I uninstall the Unity extension, and then uninstall the c# dev kit extension, then reinstall them both and reload extensions everything works until the next time I close and re-open VSCode.

@MyLegend2016
Copy link

I am also having this issue now on a Unity project. Was fine yesterday.

If I uninstall the Unity extension, and then uninstall the c# dev kit extension, then reinstall them both and reload extensions everything works until the next time I close and re-open VSCode.

Installed v1.4.29 and everything worked fine!

@tophattwaffle
Copy link

Installed v1.4.29 and everything worked fine!

Thanks for the heads up. That seems to be working fine for me now.

@adam-k-leung
Copy link

I am also having this issue now on a Unity project. Was fine yesterday.
If I uninstall the Unity extension, and then uninstall the c# dev kit extension, then reinstall them both and reload extensions everything works until the next time I close and re-open VSCode.

Installed v1.4.29 and everything worked fine!

Can confirm with my Unity project that using v1.5.20 of the C# Dev Kit extension no longer works, but manually downgrading v1.4.29 fixed things.

@Michael-Eng
Copy link
Member

@lifengl or @jbevain - could we have broken something in project query?

@ericpohl
Copy link

ericpohl commented May 9, 2024

FWIW downgrading C# Dev Kit to v1.4.29 fixed my similar issues. Using "straight" c#, no Unity or web or anything.

@lifengl
Copy link
Member

lifengl commented May 9, 2024

Based on the information posted earlier, it looks like the project system failed to load. Based on the timeline, it is about the time when the project system hosting process was updated to support Aspire projects, but there are also many other things happening about the same time. To understand what was going on, we need help if anyone running into this issue could send us some log files from the extension.

In the session when the extension failed, use vscode command "open extension logs folder", and browse into ms-dotnettools.csdevkit\ServiceHub sub-folder, the first interesting one is named like this:

-hubController--*-1.log

this file should capture some command line information to start the project system process.

The second one is named like -dotnet--*-1.log, which contains the initial logging of the project system hosting process.

The third one is named like -Microsoft.VisualStudio.ProjectSystem.CompositionService--*-1.log, including the project system initialization log.

If the system failed earlier, the later log files might be missing. Or, the earlier log might show things working, and a later failure point might be logged in a later log file.

if anyone can help to provide some content of those files, (or sometime, an exception with call stack in one of that would help us to narrow down what is going on.

also output of dotnet --info might help. Although the original issue was reported from a non-windows platform, the later screen-shot is clearly from a windows machine. The dotnet info command provide some version information of dotnet SDK installed on the machine, sometime, we may not aware of problems when the extension might be broken on a slightly older runtime...

@mertdorukkalkan
Copy link

mertdorukkalkan commented May 10, 2024

Anyone can help for this situation ? i don't know how to downgrade and i cant see the the version of v1.4.29image

@ericpohl
Copy link

@mertdorukkalkan Go to the "C# dev Kit" extension in VSCode. Next to the Uninstall button is a pulldown that will let you install a different version.
image

@lifengl lifengl added the needs-more-info Needing more information, waiting on OP label May 10, 2024
@hbflyhbfly
Copy link

I change the "C# dev Kit" ver from v1.5.20->1.4.29 fixed it.
image

@Doekin
Copy link

Doekin commented May 12, 2024

Maybe the extension requires ASP.NET Runtime .
I have .NET SDK installed when encountered this problem, and after installing ASP.NET Runtime, everything works.

The naming convention is too difficult for me to understand.

@lifengl
Copy link
Member

lifengl commented May 14, 2024

@Doekin ,

that is what I thought. The difference between 1.5.20 and 1.4.29 is that the newer version requires ASP.NET runtime. Usually, APS.NET would be installed when .NET SDK is installed. Can you run dotnet --info, which may explain what has been installed on the machine?

@lifengl
Copy link
Member

lifengl commented May 14, 2024

hmm... I guess one possibility is that the machine has NET 8 Core runtime, but no ASP.NET runtime. Because ASP.NET runtime is installed with SDK, so maybe the machine running into this problem has newer runtime + older SDKs? I wonder maybe certain configuration confused the extension so it picks up a wrong runtime configuration.

@Doekin
Copy link

Doekin commented May 14, 2024

On Arch, ASP.NET Runtime is not installed with SDK. 😂

Running command pacman -S dotnet-sdk will install the following paackages

we now have

To get ASP.NET Runtime, we should run pacman -S aspnet-runtime

@max8rr8
Copy link

max8rr8 commented May 14, 2024

Same problem on Arch, fixed by installing pasman -S aspnet-runtime

@AppliedK
Copy link

The issue is resolved by installing the older version of C# Dev Kit. I have now installed v1.5.14 as shown in screenshot below and disabled auto update of extension in VS Code.
To disable auto-update in Visual Studio Code (VS Code), you can follow these steps:
Open Settings:
Press Ctrl+, (Windows/Linux) or Cmd+, (Mac) to open the Settings tab.
Alternatively, you can click on File > Preferences > Settings.
Search for "update":
In the search bar at the top of the Settings tab, type "update". This will filter the settings to show those related to updates.
Disable Auto-Update:
Look for the setting named "Update: Mode" or similar.
Change the value to "none". This setting usually has options like "manual", "default", or "none". Setting it to "none" disables auto-update.
Save Changes:
Close the Settings tab, and VS Code will automatically save your changes.
After following these steps, VS Code should no longer automatically update itself. You'll need to manually check for updates and install them if desired.
VS Code Issue

@AppliedK
Copy link

Anyone can help for this situation ? i don't know how to downgrade and i cant see the the version of v1.4.29image

If you are still having issue. You can install v1.5.14. Look at my comment how to do it.

@ericpohl
Copy link

@lifengl I finally had a chance to gather logs as you suggested. Starting the 1.5.20 version I get:

Error : You must install or update .NET to run this application.

Error : The following frameworks were found:
6.0.22 at [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
7.0.11 at [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]

After installing .NET SDK 8.0 everything works fine now.

@lifengl
Copy link
Member

lifengl commented May 14, 2024

thanks @Doekin and @ericpohl,

yeah, it is clear the assumption that the SDK carrying the ASP.Net runtime is incorrect. It is the story to use the Microsoft installation directly. We will find out a solution for this.

In the meaning time, installing ASP.NET runtime would be a straight workaround.

@lifengl lifengl assigned tmeschter and unassigned lifengl May 15, 2024
@lifengl lifengl added area-project Project load, Solution Explorer high-priority and removed needs-more-info Needing more information, waiting on OP area-project-cps labels May 15, 2024
@lifengl
Copy link
Member

lifengl commented May 16, 2024

While the team is working on a fix, to work around this issue:
1, install .NET SDK 8.0 to the machine
2, if you are using Arch Linux, make sure install NET 8 Asp.Net runtime along with the NET 8 SDK to the machine.

@phadkesharan
Copy link

I am also having this issue now on a Unity project. Was fine yesterday.

If I uninstall the Unity extension, and then uninstall the c# dev kit extension, then reinstall them both and reload extensions everything works until the next time I close and re-open VSCode.

Thank you! works fine with v1.4.29

@yarpenzigren32850
Copy link

Yes, everything worked for me after installation, too.NET SDK

@ruanmed
Copy link

ruanmed commented May 28, 2024

While the team is working on a fix, to work around this issue: 1, install .NET SDK 8.0 to the machine 2, if you are using Arch Linux, make sure install NET 8 Asp.Net runtime along with the NET 8 SDK to the machine.

I was getting the "Microsoft.VisualStudio.CpsProjectIconSourceService (0.1)" service failed. notification whilst trying to open Solution Explorer, and it seems to be solved after installing the aspnet-runtime package that was missing, I thought I only needed the dotnet runtime and SDK packages.

Thanks!

@tmeschter
Copy link
Member

Note that the latest prerelease version (currently 1.7.4) has a fix such that the ASP.NET runtime will only be needed if you are launching/debugging Aspire app host projects. This bug will be closed when that fix makes it to a release version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-project Project load, Solution Explorer bug Something isn't working fixed high-priority triaged The issue has been triaged
Projects
None yet
Development

No branches or pull requests