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/documentation/troubleshooting_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)
Build/Test Issues
Build fails due to dependency on .git directory
Started by onovotny on 11,956 views
Remco NCrunch Developer
#10004
17 Mar 2017 22:51 UTC
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.
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.
Okay, fixed it and submitted a PR to GitVersion to make my fix part of the default.
The removed it :/
Post a reply
Log in to reply.