Skip to content

Conversation

@arturcic
Copy link
Member

@arturcic arturcic commented Mar 4, 2020

Closes #2153

@arturcic arturcic merged commit 7fba886 into GitTools:master Mar 4, 2020
@arturcic arturcic deleted the fix/gh-2153 branch March 4, 2020 18:56

<PropertyGroup>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<TargetFrameworks>net472;netstandard2.0</TargetFrameworks>
Copy link
Contributor

@dazinator dazinator Mar 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it was this that was the main part of the problem. This assembly needs to be cross compiled for full net framework and .net core, .net core msbuild ends up using the .net standard compiled one, and .net framework msbuild needs to use the full .net (net472) compiled version of the assembly - that's becuase in this assembly there is stuff like this:

  static TaskProxy()
        {
#if !NETFRAMEWORK
            GitLoaderContext.Init("GitVersionCore", "LibGit2Sharp");
#endif
            LibGit2SharpLoader.LoadAssembly("GitVersionTask");

If we only build the .net standard version of the binary to be used by both .net core and net framework msbuild variants, then it doesn't exhibit the correct dependency loading behaviours.

I had fixed this in my PR, but I broke other things when trying to refactor task proxy. I have decided to start my PR again from a clean branch off latest master, and I'll just do some more targetted fixes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm working now on adding some integration tests using msbuild and dotnet build to validate the GitVersionTask, when that is in place I think we can release, and you can use that for validating the refactoring you're doing. As for the support for preview builds of msbuild I think we need to handle that after this release,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The "WriteVersionInfoToBuildLog" task could not be loaded from the assembly

2 participants