-
Notifications
You must be signed in to change notification settings - Fork 654
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
GitVersion 6.0-beta.1 : Error on WriteVersionInfoToBuildLog with can't load System.Runtime 6.0.0.0 on a .NET 7 project #3450
Comments
Additional information : I have .net 8 preview installed. But my projects are all .net 7 release. |
Can you send us a sample project that can reproduce this issue? We have some integration tests for .net6.0 and .net7.0 that executes the build having this package installed as part of our pipeline, and it seems to be working fine |
I created a bare minimum console app from Visual Studio's template. Can't be simpler than that.
I get the infamous Visual Studio yellow triangle of Death : And the same error as before : And finally my Program.cs code :
I also purged .NET 8 preview from my system. .NET version used by the .NET CLI and Visual Studio is .NET 7.0.202 (7.0.4). |
Changing the target framework (5, 6, 7) doesn't make any difference. Error still present. |
Building with the CLI works fine. ETA : "dotnet build" works, msbuild (CLI) doesn't. |
*** Assembly Binder Log Entry (2023-04-02 @ 1:35:52 PM) *** The operation failed. Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll === Pre-bind state information ===
|
Sooooooooooooo Tried a workaround. I added "C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.15\System.Runtime.dll" to the Global Assembly Cache (GAC). It worked! Sort of... Now I get the same error but for System.Private.CoreLib.dll. Problem is I can't add that dll to the GAC. Gacutil refuse. |
Ok last attempt. Copied System.Runtime.dll and System.Private.CoreLib.dll to gitversion.msbuild tools directory. Now I get the error "can't load type System.Object from System.Private.CoreLib because the parent does not exist". |
Closed by #3474 |
🎉 This issue has been resolved in version 6.0.0-beta.3 🎉 Your GitReleaseManager bot 📦🚀 |
I have an older solution with 4 projects in it. They were all .net 5 and using an older (5.x) version of GitVersion. I upgraded to 6.0 and also the framework to 7.0. After resolving the breaking changes from GitVersion from 5.x to 6.x I stumbled on an error that I have no idea how to resolve. I get the following for my 4 projects in my solution:
The "WriteVersionInfoToBuildLog" task could not be loaded from the assembly C:\Users\efort.nuget\packages\gitversion.msbuild\6.0.0-beta.1\tools\net6.0/GitVersion.MsBuild.dll. Could not load file or assembly 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.
Would appreciate some help. If I should not post this kind of thing here please let me know. But since it's a Beta release it may be a bug or regression to fix so here I am :)
The text was updated successfully, but these errors were encountered: