-
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
In GitVersion.MsBuild 5.6.3, AfterTargets="GetVersion" causes msbuild warning '"WriteVersionInfoToBuildLog" task could not be loaded' #2533
Comments
I tested with all nuget package versions out and saw the same behavior. I assume GitVersion.MsBuild should replace GitVersionTask and has to be used the same way, even though I could not find any documentation. Is my assumption correct? While GitVersion.MsBuild does not yet work and is not documented, does it make sense to mark GitVersionTask deprecated? Because the replacement seems not ready to me. |
@sjoerd222888
|
It's worth noting that I experienced this bug when converting from |
It is on purpose because the implementation of the task is different, the only bug was where the file gets written to, but we addressed that |
I was not able to get beyond the error message, even with cleaning. I will investigate whether I can somehow getting it to work. Just to make sure I am not in another case I post my error message:
Worth mentioning that I build for net48 and netcoreapp3.1
I can confirm it work when only building for netcoreapp3.1.
And it also works when building solely against net48
But two target frameworks, net48 and netcoreapp3.1 at the same time seems to cause an issue. @arturcic Thanks for your feedback, I understand it should work, at least basically. I see your tests work. My feedback was not appropriate with this respect. |
I think this issue needs more information to be able to resolve this: In my own solution I'm building net462, net5.0, monoandroid10, Xamarin Mac without any issues. I've been getting issues like this before 5.6.3 as it looks like MSBuild's build processes can't load the same assembly for different target frameworks, once one was already loaded by that process. That was due to For the whole solution it now just grabs one dll, i.e. the target frameworks of your projects no longer matter:
I'm on VS on Windows, using version 16.8.4. The error sounds like either the dll is broken, or perhaps you're on a preview VS release and there's a dependency issue? Perhaps try this to ensure you're trying from a clean state:
Then again, you're saying it works if you only build one project at a time? 🤔 |
@bddckr I tried to test whether this is a problem only in the VS pre-release. So I rebuilt my solution with the VS release version and the problem was gone. Then I rebuilt with the preview and the problem is still gone! I don't know what caused the warning to go away. A windows update recently caused my computer to reboot so perhaps a reboot is helpful after uninstalling GitVersionTask and installing GitVersion.MsBuild 5.6.3? |
Closing this one, it should be fixed in 6.0.0-beta3 |
🎉 This issue has been resolved in version 6.0.0-beta.3 🎉 Your GitReleaseManager bot 📦🚀 |
The following target dependency causes VS build to generate a warning:
<Target Name="CalculateVersionCodeProperties" AfterTargets="GetVersion;_CompileAppManifest" BeforeTargets="CoreCompile">
The warning:
Warning The "WriteVersionInfoToBuildLog" task could not be loaded from the assembly ...gitversion.msbuild\5.6.3\tools\net48/GitVersion.MsBuild.dll. Method 'RegisterTypes' in type 'GitVersion.MsBuild.GitVersionTaskModule' from assembly 'GitVersion.MsBuild, Version=5.6.3.0, Culture=neutral, PublicKeyToken=null' does not have an implementation. 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.
Expected Behavior
No warning
The text was updated successfully, but these errors were encountered: