Skip to content
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

GitVersion 4.0.0 fails when Registry Key EnableOutOfProcBuild is set #1512

Closed
gianluco opened this issue Oct 22, 2018 · 2 comments
Closed

GitVersion 4.0.0 fails when Registry Key EnableOutOfProcBuild is set #1512

gianluco opened this issue Oct 22, 2018 · 2 comments

Comments

@gianluco
Copy link

Hi,

We are using GitVersion 4.0.0 in our CI Jenkins environment, where we build our VS 2017 solution using devenv.com from command line in order to build all our projects including installers.

For the installers to be built we have defined the registry key EnableOutProcBuild:
(it3xl/MSBuild-DevEnv-Build-Server-Workarounds#1)
(https://www.kunal-chowdhury.com/2016/07/visual-studio-error-code-8000000A.html)

When building we consistently get the following error:

MSBUILD : error : Error occurred: System.Exception: Warning logger not defined. Attempted to log: Could not determine assembly version: System.Exception: Warning logger not defined. Attempted to log: Failed to check build server 'Jenkins': Info logger not defined. Attempted to log: Applicable build agent found: 'Jenkins'. MSBUILD : error : at GitVersion.Logger.<>c.<Reset>b__24_2(String s) MSBUILD : error : at GitVersion.BuildServerList.GetApplicableBuildServers() MSBUILD : error : at GitVersion.ExecuteCore.ExecuteGitVersion(String targetUrl, String dynamicRepositoryLocation, Authentication authentication, String targetBranch, Boolean noFetch, String workingDirectory, String commitId, Config overrideConfig, Boolean noCache)

I've reproduced the error on my machine (rather than Jenkins build slave) by defining the registry key and getting the Logger error on this other tracing instead:

MSBUILD : error : Error occurred: System.Exception: Warning logger not defined. Attempted to log: Could not determine assembly version: System.Exception: Info logger not defined. Attempted to log: IsDynamicGitRepository: False MSBUILD : error : at GitVersion.Logger.<>c.<Reset>b__24_1(String s) MSBUILD : error : at GitVersion.GitPreparer.GetProjectRootDirectory() MSBUILD : error : at GitVersion.ExecuteCore.ExecuteGitVersion(String targetUrl, String dynamicRepositoryLocation, Authentication authentication, String targetBranch, Boolean noFetch, String workingDirectory, String commitId, Config overrideConfig, Boolean noCache) MSBUILD : error : at GitVersion.ExecuteCore.TryGetVersion(String directory, VersionVariables& versionVariables, Boolean noFetch, Authentication authentication) MSBUILD : error : at GitVersion.Logger.<>c.<Reset>b__24_2(String s) MSBUILD : error : at GitVersion.ExecuteCore.TryGetVersion(String directory, VersionVariables& versionVariables, Boolean noFetch, Authentication authentication) MSBUILD : error : at GitVersionTask.WriteVersionInfoToBuildLog.InnerExecute() in C:\projects\gitversion\src\GitVersionTask\WriteVersionInfoToBuildLog.cs:line 50 MSBUILD : error : at GitVersionTask.WriteVersionInfoToBuildLog.Execute() in C:\projects\gitversion\src\GitVersionTask\WriteVersionInfoToBuildLog.cs:line 28

(Or, as alternative by defining the JENKINS_URL env variable and getting the first error)

@tpaxatb
Copy link
Contributor

tpaxatb commented Mar 18, 2019

Ran into the same problem with attempting to add GitVersionTask to a wixproj
It appears that visual studio devenv IDE actually loads the non C#/VB projects in its own process space and reuses the Task to build the wixproj (unlike C# and VB projects which are delegated to children). It appears that the core issue is that the GitVersion tasks assume they will never be reused; the task constructors calls Logger.SetLoggers to set the loggers, but they are subsequently reset in the finally clause of the Execute() call. Not quite sure why that is, I would have assumed that the loggers should be set at the beginning of the Execute() call if they are going to be reset at the end of the call.

@arturcic
Copy link
Member

Closing this in favor of #1643

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

No branches or pull requests

3 participants