dotnet / dotnet/msbuild

Consider shipping separate copies of Msbuild binaries that are loaded to devenv process

Open
#3,377 3 comments 0 reactions 0 assignees View on GitHub
triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 13h
Merged PRs (30d)
133

Description

Currently the binaries are loaded from the same directory msbuild.exe runs and the msbuild VS component is configured to use the same NGEN configuration as devenv.
This means that all dependencies that msbuild and VS have in common must be exactly the same, making updating them in VS complicated.

**Proposal**

Install msbuild binaries that are used from within devenv.exe and ServiceHub processes into a separate directory in VS (e.g. `[installDir]\Common7\IDE\CommonExtensions\Microsoft\MSBuild`) and load them from there, instead of `[installDir]\MSBuild\15.0\Bin` directory.

[Update swr file](https://github.com/Microsoft/msbuild/pull/3375) to specify `vs.file.ngenApplication="[installDir]\MSBuild\15.0\Bin\msbuild.exe"`, so that NGEN of binaries in `MSBuild\15.0\Bin` is independent of VS NGEN.

**Background**

Updating VS dependencies concerns the following types of components:
- Components built from the internal VS repository use VS-wide build variables to generate their binding redirects and pull their dependencies from a common location. Updating these is simply matter of changing a few build variables.

- Components built outside of VS repository that are loaded into devenv process (or other process that shares the same runtime configuration, such as SeviceHub) can be built against lower versions of their VS dependencies. They will be automatically redirected to the version VS specifies in devenv.exe.config.

- Components built outside of VS repository that are loaded in a separate process using its own runtime configuration do not need to be updated.

- Components built outside of VS repository that are loaded in BOTH a separate process using its own runtime configuration AND devenv process (e.g. msbuild) are required to have exactly the same version of the dependencies. This sharing makes it hard to update the dependencies in VS since all such components and the VS repository itself need to be updated in a single change.

If this is implemented remove the following entries from `/src/appid/devenv/stub/devenv.urt.config.tt`:
```















```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the proposal and inspect /src/appid/devenv/stub/devenv.urt.config.tt, including the listed binding redirects. Then trace the referenced swr file and the MSBuild and Visual Studio installation paths. Done means installing separate devenv and ServiceHub MSBuild binaries, updating the NGEN setting, and removing the listed configuration entries.

Written by the indexing model from the issue text.

Assessment

Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.