-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
RepositoryTask
's usage of IBuildEngine4.GetRegisteredTaskObject
breaks under multiple AssemblyLoadContext
s.
#8478
Comments
I haven't seen that error before in a MSBuild should cache ALCs by path to plugin assembly, so it shouldn't be the case that there are two |
I created a repro in the https://github.com/teo-tsirpanis/Farkle/tree/msbuild-repro branch. To run it you have to first run Something I thought it might be the problem is that I'm using a |
Thanks for the repro. MSBuild Team: let's prioritize investigating this, since it appears to be a failure in a using-all-the-new-cool-stuff scenario. |
@teo-tsirpanis So, yes, your build is misconfigured. You're loading two copies of Source Link - one from package cache in |
Fixed by dotnet/sourcelink#1034 |
Thanks! |
I enabled Central Package Management in my repository and put
Microsoft.DotNet.ReproducibleBuilds
in aGlobalPackageReference
, which means that all my projects have Sourcelink enabled. Now when I build one of these projects, I get this error right here (also opened dotnet/runtime#80526 to track its unhelpfulness):This error message tells us that the two
GitRepository
ies are different. My guess is that MSBuild loads the task assembly once for each project, and they get theGitRepository
from a previous invocation, which resides in a different ALC and fails to cast.The approach of caching the repository information has to be revisited. For now I will limit SourceLink to just my library projects.
The text was updated successfully, but these errors were encountered: