Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Build fails due to dependency on .git directory
onovotny
#1 Posted : Friday, March 17, 2017 1:57:14 PM(UTC)
Rank: Member

Groups: Registered
Joined: 3/17/2017(UTC)
Posts: 12
Location: United States of America

Was thanked: 2 time(s) in 2 post(s)
If you use GitVersionTask to update the assembly info files in any of the projects, NCrunch will fail to build it. This leads to errors with SDK-style projects because the Version won't be set and targets will fail.

GitVersionTask looks up the directory tree for the .git directory.

NCrunch: If you are experiencing problems in getting this project to build, have a look at http://www.ncrunch.net/d...ng_project-build-issues
..\..\..\..\..\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.GenerateAssemblyInfo.targets (120, 5): The "GetAssemblyVersion" task was not given a value for the required parameter "NuGetVersion".
..\..\..\..\..\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.Sdk.targets (92, 5): The "GenerateDepsFile" task was not given a value for the required parameter "AssemblyVersion".


WARNING - : WARN [03/17/17 9:45:55:75] Could not determine assembly version: System.IO.DirectoryNotFoundException: Can't find the .git directory in C:\Users\oren\AppData\Local\NCrunch\28412\6\System.Interactive.Async
at GitVersion.GitPreparer.GetDotGitDirectory()
at GitVersion.ExecuteCore.ExecuteGitVersion(String targetUrl, String dynamicRepositoryLocation, Authentication authentication, String targetBranch, Boolean noFetch, String workingDirectory, String commitId, Config overrideConfig, Boolean noCache)

Remco
#2 Posted : Friday, March 17, 2017 10:51:53 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi,

Thanks for sharing this problem.

This probably happens because NCrunch makes a copy of the project into its own workspace when it executes a build. This copy doesn't have the .git directory available, so the build target fails.

There are two ways to solve this problem:
1. Include the .git directory and/or relevant git files in your NCrunch workspace using the additional files to include setting.
2. Adjust your build system so that it is not dependent on this build target when building under NCrunch. You may wish to use an NCrunch-specific override for this.
onovotny
#3 Posted : Saturday, March 18, 2017 2:13:27 PM(UTC)
Rank: Member

Groups: Registered
Joined: 3/17/2017(UTC)
Posts: 12
Location: United States of America

Was thanked: 2 time(s) in 2 post(s)
Okay, fixed it and submitted a PR to GitVersion to make my fix part of the default.
1 user thanked onovotny for this useful post.
Remco on 3/18/2017(UTC)
Der-Albert.com
#4 Posted : Thursday, June 27, 2019 3:41:27 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 5/17/2011(UTC)
Posts: 209

Thanks: 11 times
Was thanked: 55 time(s) in 51 post(s)
The removed it :/
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.040 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download