dotnet / dotnet/sdk

ApiCompat loading of Roslyn on NETFramework is unreliable

Open
#46,958 1 comment 0 reactions 1 assignee Claimed by @ericstj View on GitHub
Area-ApiCompat
Dominant language
C#
Stars
3.2k
Forks
1.3k
PR merge metrics
PR metrics pending

Description

APICompat will load Roslyn once since it binds to it directly and doesn't use AppDomains to isolate different bindings.

This can lead to torn state if we happen to only bind to one Roslyn assembly and later bind to a different one. See https://github.com/dotnet/sdk/pull/45872#issuecomment-2669062822

To fix this in APICompat we can do one of two things:

1. Ensure we bind to a single version of all of roslyn's assemblies by either forcing a load, or using a write-once static to capture the Roslyn assemblies path.
2. Additionally to 1, create an appdomain to host APICompat assemblies if the version of roslyn specified differs from the one already loaded.

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.