dotnet / dotnet/msbuild

Add more actionable custom Check loading error

Open
#10,619 0 comments 0 reactions 0 assignees View on GitHub
Area: BuildCheck triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 8h
Merged PRs (30d)
141

Description

### Context

When there is a mismatch between the `Microsoft.Build` assembly referenced during the build and one available in hosting process during loading - the custom check will fail to load:

![image](https://github.com/user-attachments/assets/9331737f-b4a2-4d9c-a7d1-28e24b9086cf)

```
Failed to instantiate the custom check rule with the following exception: 'Could not load type 'Microsoft.Build.Experimental.BuildCheck.BuildAnalyzer' from assembly 'Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.'.
```

This situation can happen quite often as we currently have no forward no backward compatiblity mechanism for custom checks. Let's try to see if we can dig and present more information in such situation (e.g. the actuall Microsoft.Build versions used during building the Check and loading the Check).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.