You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've noticed an inconsistent behaviour in MSBuild 15.3 when there are two projects built which use different versions of the same task factory. In .NET Desktop, the build completes successfully, while in .NET Core, the build is terminated in error: error MSB4175: The task factory "UtilPack.NuGet.MSBuild.NuGetTaskRunnerFactory" could not be loaded from the assembly "~\.nuget\packages\utilpack.nuget.msbuild\1.1.0\build\\netcoreapp1.1\UtilPack.NuGet.MSBuild.dll". Assembly with same name is already loaded".
I've attached the minimal set of files required to reproduce this. For .NET Desktop, run command "c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe" /t:TestTarget main.build. For .NET Core, run command dotnet msbuild /t:TestTarget main.build. It seems that using UnloadProjectsOnCompletion property on MSBuild task in main.build has no effect.
Here is the attached zip file, containing all required files to reproduce the issue: task_factory_issue_reproduce.zip. Zip file contains main.build file, which will be used as entrypoint, and it will restore & execute the .build files in subdirectories. Those .build files will use different versions of the same task factory (which is visible by including PackageReference to UtilPack.NuGet.MSBuild NuGet package).
I guess this is a bug on .NET Core version of MSBuild?
The text was updated successfully, but these errors were encountered:
stazz
changed the title
Inconsistent behaviour when using two different versions of same task factory
"Assembly with same name is already loaded" error when using two different versions of same task factory in MSBuild 15.3 for .NET Core
Sep 11, 2017
As an example of a use-case that is impacted by this, this prevents you from using two different versions of things like NerdBank.GitVersioning in a solution, meaning you need to upgrade everything simultaneously in lockstep, which is hard to achieve in large monorepos. It'd be great to get this fixed. 👍
Hi,
I've noticed an inconsistent behaviour in MSBuild 15.3 when there are two projects built which use different versions of the same task factory. In .NET Desktop, the build completes successfully, while in .NET Core, the build is terminated in error:
error MSB4175: The task factory "UtilPack.NuGet.MSBuild.NuGetTaskRunnerFactory" could not be loaded from the assembly "~\.nuget\packages\utilpack.nuget.msbuild\1.1.0\build\\netcoreapp1.1\UtilPack.NuGet.MSBuild.dll". Assembly with same name is already loaded"
.I've attached the minimal set of files required to reproduce this. For .NET Desktop, run command
"c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe" /t:TestTarget main.build
. For .NET Core, run commanddotnet msbuild /t:TestTarget main.build
. It seems that usingUnloadProjectsOnCompletion
property onMSBuild
task inmain.build
has no effect.Here is the attached zip file, containing all required files to reproduce the issue: task_factory_issue_reproduce.zip. Zip file contains
main.build
file, which will be used as entrypoint, and it will restore & execute the.build
files in subdirectories. Those.build
files will use different versions of the same task factory (which is visible by includingPackageReference
toUtilPack.NuGet.MSBuild
NuGet package).I guess this is a bug on .NET Core version of MSBuild?
The text was updated successfully, but these errors were encountered: