microsoft / microsoft/VSExtensibility

VSSDK: COM server with .NET 7.0+ fails to locate runtime when hosted in VSIX editor

Open
#511 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
440
Forks
63
Avg merge
2d 12h
Merged PRs (30d)
1

Description

Description:
We are developing a VSIX extension that provides a custom editor to process .NET assemblies. Since VSIX itself runs on .NET Framework, we had to separate the editor into its own assembly (.NET 7.0 or later) and connect it with the extension via COM. The editor is implemented using VSSDK, because VisualStudio.Extensibility does not yet expose the necessary APIs.

Problem:
The setup works correctly when the COM server targets net6.0:

  • The COM host first searches 'C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin', and then 'C:\Program Files\dotnet'.
  • The framework is found, and the server starts as expected.

When switching the COM server to net7.0 (or higher):

  • Starting with .NET 7.0, multilevel lookup is disabled, so only the directory 'C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin' is searched but the 'C:\Program Files\dotnet' directory is not searched at all.
  • The log outputs: 'No frameworks were found'.
  • The whole extension crashes.

Question: Is there any supported way to override or configure the search path for the runtime frameworks, so that instead of only scanning 'C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin' it will also include (or redirect to) 'C:\Program Files\dotnet'.

What I've tried:

  • Update VS to the latest version
  • Setting 'DOTNET_ROOT' env variable to "..\ProgramFiles\dotnet"

I've attached logs when using both net6.0 and net7.0:
COM host log - net7.txt
COM host log - net6.txt

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the attached COM host logs for net6.0 and net7.0, focusing on the runtime framework search paths and the “No frameworks were found” result. Research the VSSDK COM-host runtime configuration and determine whether a supported path override exists; done means documenting or confirming a supported way to locate the .NET runtime.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.