-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
AssemblyLoadContext-related task errors in 16.5 #5202
Comments
Figured out the SpecFlow case: SpecFlowOSS/SpecFlow#1912 (comment). In short, this is an expected behavior of |
@rainersigwald It turns out it isn't solved by coverlet.msbuild 2.8.1. This PR is blocked in updating to .NET SDK 3.1.201 because of this same break, and updating coverlet didn't fix it. So I'm still blocked. |
@AArnott sorry it took me a while to get to this, but I don't see anything that looks like an MSBuild task failure in that PR. Can you point me to what you think is failing? |
Quite right. I forgot in that PR that updating to coverlet.msbuild 2.8.1 also changes the filenames of the coverage files generated, so there's more to adapting to the task loader change than just updating the package reference. |
Closing: all of the known active-development tasks that had problems have been fixed in new releases. |
For gitversion, recent exceptions customers have been facing have been the below: Adding a comment to help with customer searches. |
Background
Before 3.1.200, MSBuild tasks and their dependencies were loaded into the default ALC. Since an ALC can have only one assembly loaded for the same name (not including version), this forced all tasks to use the same version of dependencies, and that version had to match the one delivered in the .NET Core SDK (if the assembly was there). This was very annoying and broke people.
In MSBuild 16.5/SDK 3.1.200, we isolated plugins in their own ALC (#4916). We planned to extend this in the .NET 5 timeframe to use an AssemblyDependencyResolver, to further improve the situation for native dependencies (#5037).
There is an environment-variable-based workaround
MSBUILDSINGLELOADCONTEXT=1
available to revert to the previous behavior.Problems
This change broke some tasks that use reflection or fancy assembly loading inside the task implementation. All users of affected tasks are broken, not just the maintainers of the tasks.
Known failures are:
• GitVersionTask (457 NuGet downloads/day)
• Fody <6.0.4 (2730 downloads/day, but I don’t know the version breakdown)
• SpecFlow (3215 downloads/day)
• MSBump (92 downloads/day, repo archived)
Related issues
The text was updated successfully, but these errors were encountered: