Closed Chryssie closed 3 years ago
@chryssie Thanks! Was the project you work on .NET Core or .NET Framework based? I believe the NuGet assemblies aren't in the folder next to MSBuild for Visual Studio (/.NET Framework MSBuild) scenarios.
FWIW I used this patch from a test project and it broke ("MSBuild assemblies were already loaded" error) because the test SDK (Microsoft.NET.Test.Sdk
etc) brings in NuGet.Frameworks
and loads it before any of the locator code can run.
Thanks, @mhutch! @Forgind, sounds like more evidence we should go with the approach in #107 that makes assemblies available but doesn't complain if they're already loaded.
Note that #107 alone won't fix the NuGet problem because NuGet isn't next to MSBuild in VS scenarios, but I think it'll work for Core.
Since this by itself causes a problem and #107 should fix both, closing this. Thanks again @Chryssie!
Do you think it would make sense to also add that we look in Path.Combine(msbuildPath, "..", "..", "..", "Common7", "IDE", "CommonExtensions", "Microsoft", "NuGet") for anything starting with "NuGet" and ending in ".dll"?
@forgind I think that's a reasonable start to tackling #86 for VS, yes.
This should fix #86 and has done so in a project I work on.