-
Notifications
You must be signed in to change notification settings - Fork 652
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
Building using dotnet build fails for .NET Standard library project #1175
Comments
@onovotny any thoughts? :) |
Yeah, it cannot work with Once GitVersion has .NET Standard versions of the underlying assemblies, we can create .NET Standard build task and support it easily. I believe LibGit2Sharp now has this support as NerdBank.GitVersioning has a .NET Standard version now that uses LibGit2Sharp. |
Which of GitVersion's dependencies are currently blocking progress on the migration? |
@TAGC: Not sure. Here's a dump of GitVersion's
I assume most of these need to be ported to .NET Standard before GitVersion can? |
@asbjornu Yes... or an alternative would have to be found for them. The ones that do not exist are:
|
Just hit this when running
|
Just saw on Twitter that the PR for LibGit2Sharp got merged. That brings this issue one step closer to resolution, it would seem. |
Yep after a quick survey, only PepitaPackage and ApprovalTests don't have netstandard support? |
I don't think ApprovalTests should matter as this is a build time only dependency surely - (i.e for running tests) so shouldn't be a dependency that is forced onto consumers? |
Also just a note to say that even though calling msbuild instead of dotnet cli will provide a workaround for some scenarios, for others, like |
I have looked at the dependencies and filtered down the relevent ones for <package id="GitTools.Core" version="1.2.1-beta0001" targetFramework="net40" />
<package id="ILRepack" version="2.0.13" targetFramework="net40" />
<package id="LibGit2Sharp" version="0.23.0-pre20160922233542" targetFramework="net40" />
<package id="LibGit2Sharp.NativeBinaries" version="1.0.160" targetFramework="net40" />
<package id="YamlDotNet" version="3.8.0" targetFramework="net40" /> |
Notable we would need to add support for netcore to GitTools.Core first. |
So the blockers seem to be:
YamlDotNet has a .NET standard version of the package that I assume we could switch too. https://www.nuget.org/packages/YamlDotNet.NetCore/ |
@dazinator: |
@asbjornu I started on the port of |
I have got gittools.core building for net standard now (under appveyor). Nuget package is here: https://ci.appveyor.com/project/GitTools/gittools-core/build/1.2.1-PullRequest.42+33.build.122/artifacts |
Im planning on starting the PR for this, this week. Not sure what to do about ILRepack just yet but we shall see! |
The msbuild task needs to be built for netdesktop and netstandard, and the targets need to load the correct assembly at build time based on detecting whether its bulding on netcore or not. See: GitTools/GitLink#168 (comment) |
Hit a hurdle. The continua CI support relies on |
Hit another hurdle.. |
Haven't been able to resolve some compilation errors yet due to lack of replacemnt API's on netstandard.
Any reference to |
It looks like it's used to format version numbers in line with a customisable template. I won't be able to look at this again for a while now, so happy for someone else to give this ago. Perhaps I should raise "Remove / Replace System.Web" as a new / separate issue? |
@dazinator: Yes, that would be a bit easier to tackle. 👍 |
@kieranbenton |
Right we think we have resolved the libgit2sharp native dependency issue now. So no need to use my fork of libgit2sharp after all. Next thing I / we need to do is get the appveyor build working and publishing nuget packages similar to gittools.core. anyone can feel free to jump in and look at the appveyor build / travis builds of the netstandard PR, Just drop a note if you do so that we dont overlap. |
@dazinator can you grant me access to appveyor to take a look? Haven't managed to find any details in the wiki of how I might have a poke around to see how the build is failing. |
@kieranbenton - I am not sure I have the powers.. I only get access to AppVeyor because I was added to the |
Seems like I'm an administrator, but I have no idea how to grant someone else permissions. Ideas? |
I'm not an appveyor expert unfortunately (though ive poked my way around most other CI/CD systems) - so if its simpler than getting me access maybe someone else can have a look and I can just do some QA for you? |
@asbjornu - I assume they have to be added to the github |
My plan for the PR is to get the builds working so it piblishes a nuget package which will support netcore / netstandard 1.X projects. Then after that, upgrade to the next version of libgit2sharp which requires netcoreapp2.0 / netstandard 2.0. That way we get an interim package published that will support anyone stuck on 1.X, but moving forward we will require 2.0 becuase thats what libgit2sharp now requires. |
Any progress on this? @dazinator: Do you thing this makes any sense at all to have a 1.x version running, just for the sake of it? People who initially started with ASP.NET Core 1.x and are stucked to it didn't had the opportunity to use GitVersion at all so they already managed to come out w/o it or upgraded to 2.0 already (as there are other benefits). People starting new project will start with 2.0 already, since it has way wide and more APIs. So there shouldn't be too much people who use 1.x already and even less who use GitVersion with it, since it doesn't work with the new csproj structure. At least not fully (assembly versioning) |
@TsengSR You are more than welcome to take a fork and retarget the PR in your own branch to target netstandard2.0 if you want. My plan after this is building and publishing packages again is to upgrade to netstandard 2.0 anyway. Alternatively if you want to assist (this goes for anyone) please investigate the appveyor build! :-) |
Oh and also I have production asp.net core 1.1 apps, building with dotnet sdk / cli 1.x targeting net461 that I'd like the gitversion msbuild task to work for so thats my vested interest for wanting to get a 1.x build before upgrading to 2. |
|
@dazinator did you see the edits by @gabrielweyer in #1269 (comment)? |
@tmds Nope I missed it! But I will look at that now! |
Is this going to be released any time soon? It would make our CI much easier. |
Any news on this one? I think there is still a lot of interest in it. :) What are the blockers as of now? |
Checkout the pr named Netstandard. It has instructions. Short answer is yes you can do this now. Not yet been merged but you can try the PR nuget packages. Let me know how you get on! |
Sounds good! Thanks! |
@dazinator: That sounds good though, but can that one be used with the TFS/VSTS pipeline? The only available package for VSTS fromt he store is 3.6.5 one. It would be cool to have the 4.x .NET Standard bits packaged within it, and allows us to change the Version via the little "version" drop-down menu? Microsoft does the same with the TFS/VSTS BuildTasks for .NET Core, where they'd set "1." versions as default and "2. (Preview)" (its out of preview by now already) could be chosen manually when needing the newer version? I played around with the the GitVersionTask nuget packages including into your project on our VSTS build pipeline, but right now it only works on the hosted Windows Pipelines, not on the linux based ones (due to lack of mono and .NET Core/Standard support). Or is the VSTS BuildTask Extension obsolete now with the 4.x versions and we just need to use the dotnet core build task and invoke the cli? One bit success I had a few months ago with the Extensions and the nuget packages available form the official nuget feeds (4.0 beta12 preview iirc) was to generate the appropriately assembly versions in AssemblyInfo.cs, but only with the Extension and on Windows Hosted Build Agent. |
The TFS package, and the GEM package aren't being built from the PR branch yet unfortunately.
Do any of those options help? Customising the TFS package is beyond my experience, I would like to get the artifcat being built in the PR branch as a first step! |
Will try that in 2 or 3 after my vacation.. GitVersion on TFS/VSTS is a bit of a strange beast. On one side we need the assemblies to have a specific version so it can version it on the other side the nuget packages and the build itself, so a mix of both NugetPackage based tasks and cli is required to get proper versioning for CI/CD. |
Any joy on this? |
@dazinator how do I get the PR nuget packages? |
@fleed you donate £10 into my bank account and then I email you the package :-) On a more seripus note, this is how:
it tells you about the CI nuget feed you need to add (hosted on appveyor) and the nuget package version you need to reference. |
Are we saying there almost needs to be a matrix of GitVersion/NET Core SDK version combinations that are known to work together? |
I believe that after upgrading to LibGit2Sharp 0.26 in #1713, this problem should be fixed. Can you please try the latest build of GitVersion and report back whether it fixes this problem or not? Please reopen this issue if the problem persists. |
I'm using the latest pre-release of GitVersionTask (4.0.0-beta0011) on a .NET standard library project and it seems to work from Visual Studio 2017 but not from the command line using
dotnet build
. I'm targeting netstandard1.2.I wasn't sure whether this would work at all. I started off looking around for an implementation that installs a GitVersion package as a
DotnetCliToolReference
in an SDK csproj file. With nothing conclusive from that or from other .NET Core related issues (ex. #647) I figured I should just try adding the package reference and see what it does. I was happy at first to see it was working when building the solution from Visual Studio but building usingdotnet build
gives me the following error.According to the documentation:
Is there anywhere I can follow along with the work being done for getting GitVersionTask or some form of automated solution that works for .NET library projects?
The text was updated successfully, but these errors were encountered: