-
Notifications
You must be signed in to change notification settings - Fork 86
Build against dotnet core msbuild assemblies #168
Comments
And for more info - this same issue is currently also affecting the GitVersion msbuild task, so can see their for more details: GitTools/GitVersion#1175 |
Now that libgit2sharp has a .NET Core variety, yes it's conceivable that we could offer .NET Core build support within GitLink as well. Note that it's not a matter of simply retargeting to MSBuild's .netstandard libraries, for two reasons:
So actually any MSBuild task that intends to work both in the Keep in mind though that gitlink doesn't support the new portable PDB format that is the default with projects that are usually built with |
Good point, thanks for providing this feedback. We might look into moving towards SourceLink in the future (but it's not necessary on the short run). I suggest sticking with 2.4.1 for now, then we can slowly migrate to SourceLink in the future. |
I am in the process of doing this for gitversion's msbuild task :-( Any pointers here much appreciated - I'd prefer not to have to resort to 2 seperate nugget packages. |
Two packages is not required. And you can do with just one .targets file too, which has a Condition on all UsingTask elements so that it imports the MSBuild Core task assembly or the MSBuild (full) task assembly as appropriate. As a sample that does not use the above nuget package, you can refer to Nerdbank.GitVersioning:
|
Thank you - much appreciated, that should save me quite a bit of time there! |
* GitLink - source code location. - Use GitLink to link back to GitHub repo for source server code debug. https://github.com/GitTools/GitLink - Update copyright date[s] - Bump package version to `1.1.4` for change tracking. * Use msbuild for travis-ci rather than old xbuild. * Only run GitLink in Windows builds due to bug[s] on travis-ci builds. GitTools/GitLink#169 GitTools/GitLink#168
As suggested by @dazinator in #87
If your msbuild task is built on the full desktop version of the msbuild assemblies (i.e if these references are the desktop version of msbuild:
https://github.com/GitTools/GitLink/blob/develop/src/GitLinkTask/GitLinkTask.csproj#L53) then dotnet build won't work as the dotnet cli tooling (an the version of msbuild used) will complain that it can't load the task, as the assembly is not compatible with netcore. I believe you have to build your task against the netstandard compatible msbuild assemblies - I.e: https://www.nuget.org/packages/Microsoft.Build.Framework/15.3.0-preview-000388-01
@AArnott , you think we can just port to the new dotnet tooling?
The text was updated successfully, but these errors were encountered: