Skip to content

StrictFilePathMarshaler must be used on a FilePath #720

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

Closed
michaelnoonan opened this issue Nov 24, 2015 · 33 comments
Closed

StrictFilePathMarshaler must be used on a FilePath #720

michaelnoonan opened this issue Nov 24, 2015 · 33 comments

Comments

@michaelnoonan
Copy link
Contributor

One of our developers was consistently getting this error when building in Visual Studio 2015: Could not determine assembly version: StrictFilePathMarshaler must be used on a FilePath

I can see some references to this in libgit2sharp, and one in #652.

The only remedy we could find under pressure was to re-clone the repository.

Unfortunately we needed to keep moving and don't have the repository to reproduce it any more. Hopefully if anyone else gets this error message we can narrow down the root cause.

@JakeGinnivan
Copy link
Contributor

Gathering this is on the GitVersionTask only? I wonder if it is another bug/error which is being triggered which stops the task from generating the version number and then causes this. Hopefully the underlying bug will get found via the exe and fixed then this goes away.

I might close this issue for now, if anyone hits this then post and we can reopen to investigate.

@andrejohansson
Copy link

I have this error now on a cleanly installed Windows 10 machine with latest stable git and Visual Studio 2015 enterprise.

Suggestions how I can narrow it down?

@asbjornu
Copy link
Member

@andrejohansson It would be nice to know if you use GitVersionTask or gitversion.exe. If you use the former, output from MSBuild would be nice. Run msbuild.exe from the command line if you don't get any valuable build output in Visual Studio. If you use the latter, it should give you build output directly that will be valuable. Any build output you can get your hands on, post it here in a comment.

@andrejohansson
Copy link

I'm using the gitversiontask, this is from my csproj file:

  <Error Condition="!Exists('..\packages\GitVersionTask.3.1.2\Build\portable-net+sl+win+wpa+wp\GitVersionTask.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\GitVersionTask.3.1.2\Build\portable-net+sl+win+wpa+wp\GitVersionTask.targets'))" />
  </Target>
  <Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
  <Import Project="..\packages\GitVersionTask.3.1.2\Build\portable-net+sl+win+wpa+wp\GitVersionTask.targets" Condition="Exists('..\packages\GitVersionTask.3.1.2\Build\portable-net+sl+win+wpa+wp\GitVersionTask.targets')" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 

Here is the build output from within visual studio;

2>  Restoring NuGet packages...
2>  To prevent NuGet from downloading packages during build, open the Visual Studio Options dialog, click on the Package Manager node and uncheck 'Allow NuGet to download missing packages'.
2>  All packages listed in packages.config are already installed.
2>MSBUILD : warning : WARN [01/21/16 21:07:32:03] Could not determine assembly version: StrictFilePathMarshaler must be used on a FilePath.
2>MSBUILD : warning : WARN [01/21/16 21:07:32:04] Could not determine assembly version: StrictFilePathMarshaler must be used on a FilePath.
2>MSBUILD : warning : WARN [01/21/16 21:07:32:04] Could not determine assembly version: StrictFilePathMarshaler must be used on a FilePath.
2>  BokaMera.API.IntegrationTests -> C:\Dev\github-private\bokamera\api\BokaMera.API.IntegrationTests\bin\Debug\BokaMera.API.IntegrationTests.dll

@asbjornu
Copy link
Member

@andrejohansson Could you please do msbuild <solution.sln> on the command line so we get the full build output? The lines written by GitVersionTask are the ones I'd like to see. Use the "Developer Command Prompt for VS2015" or similar for older versions of Visual Studio to have MSBuild added to your PATH.

@JakeGinnivan JakeGinnivan reopened this Jan 31, 2016
@asbjornu
Copy link
Member

@michaelnoonan, @andrejohansson Poke. 😄

@michaelnoonan
Copy link
Contributor Author

Hi everyone. I've just had this reoccur, and I realised that repo was still using GitVersionTask.3.1.0 which was lossy - it would just write ex.Message instead of the full exception with stack trace.

Unfortunately upon upgrading to use GitVersionTask.3.4.1 the problem isn't happening any more. I say unfortunately because I was looking forward to getting to the bottom of this issue, but I can't tell for sure, because my git repository has changed state due to upgrading GitVersionTask.

Next time this happens (if ever) I'll be sure to post more details.

@michaelnoonan
Copy link
Contributor Author

Happy, but sad - it's failed again today! This is now running GitVersionTask.3.4.1.

Interestingly, running a build from the command-line works perfectly, no warnings/errors: msbuild .\source\OctopusDeploy\OctopusDeploy.sln

WriteVersionInfoToBuildLog:
  INFO [02/10/16 8:49:30:61] Project root is: c:\dev\OctopusDeploy
  INFO [02/10/16 8:49:30:64] Begin: Loading version variables from disk cache
    INFO [02/10/16 8:49:30:65] Begin: Deserializing version variables from cache file c:\dev\OctopusDeploy\.git\gitversion_cache\1867B8AF8EDD13B4A7A7E7ED6E105D8EA5CDC98B.yml
    INFO [02/10/16 8:49:30:70] End: Deserializing version variables from cache file c:\dev\OctopusDeploy\.git\gitversion_cache\1867B8AF8EDD13B4A7A7E7ED6E105D8EA5CDC98B.yml (Took: 44.12ms)
  INFO [02/10/16 8:49:30:70] End: Loading version variables from disk cache (Took: 55.00ms)
UpdateAssemblyInfo:
  INFO [02/10/16 8:49:30:70] Project root is: c:\dev\OctopusDeploy
  INFO [02/10/16 8:49:30:71] Begin: Loading version variables from disk cache
    INFO [02/10/16 8:49:30:71] Begin: Deserializing version variables from cache file c:\dev\OctopusDeploy\.git\gitversion_cache\1867B8AF8EDD13B4A7A7E7ED6E105D8EA5CDC98B.yml
    INFO [02/10/16 8:49:30:71] End: Deserializing version variables from cache file c:\dev\OctopusDeploy\.git\gitversion_cache\1867B8AF8EDD13B4A7A7E7ED6E105D8EA5CDC98B.yml (Took: 1.07ms)
  INFO [02/10/16 8:49:30:71] End: Loading version variables from disk cache (Took: 4.00ms)
GetVersion:
  INFO [02/10/16 8:49:30:72] Project root is: c:\dev\OctopusDeploy
  INFO [02/10/16 8:49:30:72] Begin: Loading version variables from disk cache
    INFO [02/10/16 8:49:30:72] Begin: Deserializing version variables from cache file c:\dev\OctopusDeploy\.git\gitversion_cache\1867B8AF8EDD13B4A7A7E7ED6E105D8EA5CDC98B.yml
    INFO [02/10/16 8:49:30:74] End: Deserializing version variables from cache file c:\dev\OctopusDeploy\.git\gitversion_cache\1867B8AF8EDD13B4A7A7E7ED6E105D8EA5CDC98B.yml (Took: 12.01ms)
  INFO [02/10/16 8:49:30:74] End: Loading version variables from disk cache (Took: 13.01ms)

But when running a Rebuild inside of Visual Studio we get this warning:

3>Target "WriteVersionInfoToBuildLog" in file "C:\dev\OctopusDeploy\source\packages\GitVersionTask.3.4.1\build\dotnet\GitVersionTask.targets" from project "C:\dev\OctopusDeploy\source\Octopus.Upgrader\Octopus.Upgrader.csproj" (target "CoreCompile" depends on it):
3>Using "WriteVersionInfoToBuildLog" task from assembly "C:\dev\OctopusDeploy\source\packages\GitVersionTask.3.4.1\build\dotnet\..\..\GitVersionTask.dll".
3>Task "WriteVersionInfoToBuildLog"
3>MSBUILD : warning : WARN [02/10/16 8:43:24:13] Could not determine assembly version: System.Runtime.InteropServices.MarshalDirectiveException: StrictFilePathMarshaler must be used on a FilePath.
3>MSBUILD : warning :    at LibGit2Sharp.Core.StrictFilePathMarshaler.MarshalManagedToNative(Object managedObj)
3>MSBUILD : warning :    at System.StubHelpers.MngdRefCustomMarshaler.ConvertContentsToNative(IntPtr pMarshalState, Object& pManagedHome, IntPtr pNativeHome)
3>MSBUILD : warning :    at LibGit2Sharp.Core.NativeMethods.git_repository_discover(GitBuf buf, FilePath start_path, Boolean across_fs, FilePath ceiling_dirs)
3>MSBUILD : warning :    at LibGit2Sharp.Core.Proxy.<>c__DisplayClass34.<git_repository_discover>b__33(GitBuf buf)
3>MSBUILD : warning :    at LibGit2Sharp.Core.Proxy.ConvertPath(Func`2 pathRetriever)
3>MSBUILD : warning :    at LibGit2Sharp.Core.Proxy.git_repository_discover(FilePath start_path)
3>MSBUILD : warning :    at LibGit2Sharp.Repository.Discover(String startingPath)
3>MSBUILD : warning :    at GitVersion.GitPreparer.GetDotGitDirectory()
3>MSBUILD : warning :    at GitVersion.ExecuteCore.ExecuteGitVersion(String targetUrl, String dynamicRepositoryLocation, Authentication authentication, String targetBranch, Boolean noFetch, String workingDirectory, String commitId)
3>MSBUILD : warning :    at GitVersion.ExecuteCore.TryGetVersion(String directory, VersionVariables& versionVariables, Boolean noFetch, Authentication authentication)
3>Done executing task "WriteVersionInfoToBuildLog".
3>Done building target "WriteVersionInfoToBuildLog" in project "Octopus.Upgrader.csproj".
3>Target "UpdateAssemblyInfo" in file "C:\dev\OctopusDeploy\source\packages\GitVersionTask.3.4.1\build\dotnet\GitVersionTask.targets" from project "C:\dev\OctopusDeploy\source\Octopus.Upgrader\Octopus.Upgrader.csproj" (target "CoreCompile" depends on it):
3>Using "UpdateAssemblyInfo" task from assembly "C:\dev\OctopusDeploy\source\packages\GitVersionTask.3.4.1\build\dotnet\..\..\GitVersionTask.dll".
3>Task "UpdateAssemblyInfo"
3>MSBUILD : warning : WARN [02/10/16 8:43:24:13] Could not determine assembly version: System.Runtime.InteropServices.MarshalDirectiveException: StrictFilePathMarshaler must be used on a FilePath.
3>MSBUILD : warning :    at LibGit2Sharp.Core.StrictFilePathMarshaler.MarshalManagedToNative(Object managedObj)
3>MSBUILD : warning :    at System.StubHelpers.MngdRefCustomMarshaler.ConvertContentsToNative(IntPtr pMarshalState, Object& pManagedHome, IntPtr pNativeHome)
3>MSBUILD : warning :    at LibGit2Sharp.Core.NativeMethods.git_repository_discover(GitBuf buf, FilePath start_path, Boolean across_fs, FilePath ceiling_dirs)
3>MSBUILD : warning :    at LibGit2Sharp.Core.Proxy.<>c__DisplayClass34.<git_repository_discover>b__33(GitBuf buf)
3>MSBUILD : warning :    at LibGit2Sharp.Core.Proxy.ConvertPath(Func`2 pathRetriever)
3>MSBUILD : warning :    at LibGit2Sharp.Core.Proxy.git_repository_discover(FilePath start_path)
3>MSBUILD : warning :    at LibGit2Sharp.Repository.Discover(String startingPath)
3>MSBUILD : warning :    at GitVersion.GitPreparer.GetDotGitDirectory()
3>MSBUILD : warning :    at GitVersion.ExecuteCore.ExecuteGitVersion(String targetUrl, String dynamicRepositoryLocation, Authentication authentication, String targetBranch, Boolean noFetch, String workingDirectory, String commitId)
3>MSBUILD : warning :    at GitVersion.ExecuteCore.TryGetVersion(String directory, VersionVariables& versionVariables, Boolean noFetch, Authentication authentication)
3>Done executing task "UpdateAssemblyInfo".
3>Done building target "UpdateAssemblyInfo" in project "Octopus.Upgrader.csproj".
3>Target "GetVersion" in file "C:\dev\OctopusDeploy\source\packages\GitVersionTask.3.4.1\build\dotnet\GitVersionTask.targets" from project "C:\dev\OctopusDeploy\source\Octopus.Upgrader\Octopus.Upgrader.csproj" (target "CoreCompile" depends on it):
3>Using "GetVersion" task from assembly "C:\dev\OctopusDeploy\source\packages\GitVersionTask.3.4.1\build\dotnet\..\..\GitVersionTask.dll".
3>Task "GetVersion"
3>MSBUILD : warning : WARN [02/10/16 8:43:24:14] Could not determine assembly version: System.Runtime.InteropServices.MarshalDirectiveException: StrictFilePathMarshaler must be used on a FilePath.
3>MSBUILD : warning :    at LibGit2Sharp.Core.StrictFilePathMarshaler.MarshalManagedToNative(Object managedObj)
3>MSBUILD : warning :    at System.StubHelpers.MngdRefCustomMarshaler.ConvertContentsToNative(IntPtr pMarshalState, Object& pManagedHome, IntPtr pNativeHome)
3>MSBUILD : warning :    at LibGit2Sharp.Core.NativeMethods.git_repository_discover(GitBuf buf, FilePath start_path, Boolean across_fs, FilePath ceiling_dirs)
3>MSBUILD : warning :    at LibGit2Sharp.Core.Proxy.<>c__DisplayClass34.<git_repository_discover>b__33(GitBuf buf)
3>MSBUILD : warning :    at LibGit2Sharp.Core.Proxy.ConvertPath(Func`2 pathRetriever)
3>MSBUILD : warning :    at LibGit2Sharp.Core.Proxy.git_repository_discover(FilePath start_path)
3>MSBUILD : warning :    at LibGit2Sharp.Repository.Discover(String startingPath)
3>MSBUILD : warning :    at GitVersion.GitPreparer.GetDotGitDirectory()
3>MSBUILD : warning :    at GitVersion.ExecuteCore.ExecuteGitVersion(String targetUrl, String dynamicRepositoryLocation, Authentication authentication, String targetBranch, Boolean noFetch, String workingDirectory, String commitId)
3>MSBUILD : warning :    at GitVersion.ExecuteCore.TryGetVersion(String directory, VersionVariables& versionVariables, Boolean noFetch, Authentication authentication)
3>Done executing task "GetVersion".
3>Done building target "GetVersion" in project "Octopus.Upgrader.csproj".
3>Target "CoreCompile" in file "C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.CSharp.Core.targets" from project "C:\dev\OctopusDeploy\source\Octopus.Upgrader\Octopus.Upgrader.csproj" (target "Compile" depends on it):
3>Building target "CoreCompile" completely.
3>Output file "obj\Debug\Octopus.Upgrader.exe" does not exist.
3>Using "Csc" task from assembly "C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Build.Tasks.CodeAnalysis.dll".
3>Task "Csc"
3>  C:\Program Files (x86)\MSBuild\14.0\bin\csc.exe /noconfig /nowarn:1701,1702,2008 /nostdlib+ /platform:AnyCPU /errorreport:prompt /warn:4 /define:DEBUG;TRACE /errorendlocation /preferreduilang:en-US /highentropyva+ /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\Microsoft.CSharp.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\mscorlib.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.ServiceProcess.dll" /debug+ /debug:full /filealign:512 /optimize- /out:obj\Debug\Octopus.Upgrader.exe /ruleset:"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Static Analysis Tools\\Rule Sets\MinimumRecommendedRules.ruleset" /subsystemversion:6.00 /target:exe /utf8output "..\Solution Items\SolutionInfo.cs" "..\Solution Items\VersionInfo.cs" SoftwareInstaller.cs Log.cs Program.cs Properties\AssemblyInfo.cs ServiceBouncer.cs "C:\Users\Michael\AppData\Local\Temp\.NETFramework,Version=v4.5.AssemblyAttributes.cs" obj\Debug\\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs obj\Debug\\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs obj\Debug\\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
3>  Microsoft (R) Visual C# Compiler version 1.1.0.51204
3>  Copyright (C) Microsoft Corporation. All rights reserved.
3>Done executing task "Csc".

I don't have much time to investigate further right now, but let me know if there's anything else I can do to help!

Mike

@asbjornu
Copy link
Member

@nulltoken Do you have any idea what might be causing this?

@nulltoken
Copy link
Contributor

That reminds me of two ancient issues.

How can one ensure GitVersionTask is actually leveraging the LibGit2Sharp version it's bundled with?

/cc @ethomson @carlosmn @jamill @SimonCropp

@asbjornu
Copy link
Member

asbjornu commented Jun 2, 2016

@michaelnoonan Is this still a problem, or has it vanished in later versions of GitVersion?

@michaelnoonan
Copy link
Contributor Author

We have had sporadic recurrences of this problem, but I'm hearing less than
previously. I will update our develop branch to the latest GitVersion and
will report back if it recurs again.

On Thu, Jun 2, 2016 at 5:49 PM, Asbjørn Ulsberg [email protected]
wrote:

@michaelnoonan https://github.com/michaelnoonan Is this still a
problem, or has it vanished in later versions of GitVersion?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#720 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/ABjVvm_hfcduxmr2GjWGV36B61UjzPkNks5qHosAgaJpZM4GoGGf
.

@asbjornu
Copy link
Member

Seems like people are still having a problem with this, since #899 was reported just now. @nulltoken, what do you mean with:

How can one ensure GitVersionTask is actually leveraging the LibGit2Sharp version it's bundled with?

I guess that question is targeted at the CC-ed people @ethomson, @carlosmn, @jamill, and @SimonCropp, but it would be great to figure this one out as it doesn't seem to have vanished even though @michaelnoonan haven't seen it in a while.

@ethomson
Copy link

@nulltoken 's question is about whether it's possible that two versions of LibGit2Sharp are somehow loaded at the same time. Since we were not previously strong name signing the library, there's a first-reference-wins sort of race condition for two people loading LibGit2Sharp from the same application domain.

So it's possible that one caller loaded LibGit2Sharp v0.19 and then asked to load LibGit2Sharp v0.22. (For instance). But they would have gotten LibGit2Sharp v0.19 instead since the only time version numbers get referenced is when an assembly is strong name signed (which none of them are).

It's probably okay that things aren't strong named signed in a lot of scenarios, but if you don't own how libraries get loaded for your entire process (and if you're an MSBuild plugin, you don't) then you can't guarantee that you're really loading the classes that you think you are.

We started strong name signing in v0.23. (At the very end of the release, it was one of the last commits merged, which makes me think that your prerelease wouldn't have it.) Now if some other MSBuild extension wants to use LibGit2Sharp v0.19 it will not impact you, you'll have a completely different copy to use.

Would you mind upgrading to v0.23 and see if this is gone?

@asbjornu
Copy link
Member

@ethomson Thanks for the info! We're currently using version 0.23.0-pre20150419160303 of LibGit2Sharp in GitVersion. If you have a later release of it than this, can you please push it to NuGet? 😄

@mkoertgen
Copy link
Contributor

mkoertgen commented Jul 20, 2016

Seems that i also see this. For me, it now occurs on some solution after freshly installed VS 2015 Update 3, MSBuild runs fine from the console. Version used is GitVersionTask 3.6.0.

gitversion console runs fine.

Here is the Build Output from VS

1>MSBUILD : warning : WARN [07/20/16 9:23:16:05] Could not determine assembly version: System.Runtime.InteropServices.MarshalDirectiveException: StrictFilePathMarshaler must be used on a FilePath.
1>MSBUILD : warning :    at LibGit2Sharp.Core.StrictFilePathMarshaler.MarshalManagedToNative(Object managedObj)
1>MSBUILD : warning :    at System.StubHelpers.MngdRefCustomMarshaler.ConvertContentsToNative(IntPtr pMarshalState, Object& pManagedHome, IntPtr pNativeHome)
1>MSBUILD : warning :    at LibGit2Sharp.Core.NativeMethods.git_repository_discover(GitBuf buf, FilePath start_path, Boolean across_fs, FilePath ceiling_dirs)
1>MSBUILD : warning :    at LibGit2Sharp.Core.Proxy.<>c__DisplayClass39.<git_repository_discover>b__38(GitBuf buf)
1>MSBUILD : warning :    at LibGit2Sharp.Core.Proxy.ConvertPath(Func`2 pathRetriever)
1>MSBUILD : warning :    at LibGit2Sharp.Core.Proxy.git_repository_discover(FilePath start_path)
1>MSBUILD : warning :    at LibGit2Sharp.Repository.Discover(String startingPath)
1>MSBUILD : warning :    at GitVersion.GitPreparer.GetDotGitDirectory()
1>MSBUILD : warning :    at GitVersion.ExecuteCore.ExecuteGitVersion(String targetUrl, String dynamicRepositoryLocation, Authentication authentication, String targetBranch, Boolean noFetch, String workingDirectory, String commitId, Config overrideConfig)
1>MSBUILD : warning :    at GitVersion.ExecuteCore.TryGetVersion(String directory, VersionVariables& versionVariables, Boolean noFetch, Authentication authentication)

For me this causes the build to fail as i am using GitVersionInformation in code.

Any new insights on this?

@mkoertgen
Copy link
Contributor

mkoertgen commented Jul 20, 2016

Uninstalling & Reinstalling the GitVersionTask package resolved this for me.

Note: Need to close VS before and restart afterwards because of file access issues.

@mkoertgen
Copy link
Contributor

mkoertgen commented Jul 20, 2016

Update: Had 2 instances of VS open. The first using GitVersionTask 3.5.4, the second (mentioned above) using GitVersionTask 3.6.0.

After resolving this from the second VS instance, it started occurring on the first VS instance.

Could be VS is sharing loaded assemblies or dll instances of libgit as said above by https://github.com/ethomson in #720 (comment)

@asbjornu
Copy link
Member

asbjornu commented Aug 9, 2016

@mkoertgen Seems like there's a new pre-release of LibGit2Sharp now. Could you upgrade to it in a PR so we can test @ethomson's theory?

@mkoertgen
Copy link
Contributor

Sure. Could take a couple of days as i am on vacation and afk.

@droyad
Copy link

droyad commented Aug 26, 2016

I just ran into this due to mixing 3.6.1 and 3.6.2 in the same solution.

@mkoertgen
Copy link
Contributor

Sorry, for being late. I'm back now and try to get to this today.

@gabri705
Copy link

Hey everyone I have this problem:

The "GitVersion" task was not found. Check the following:
1.) The name of the task in the project file is the same as the name of the task class.
2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface.
3.) The task is correctly declared with in the project file, or in the *.tasks files located in the
"C:\Program Files (x86)\MSBuild\14.0\bin" directory.
Barcoding.Jdl.Android
C:\Users\engineering\Documents\Visual Studio 2015\Projects\SiteOne\Barcoding.Jdl.Android\Barcoding.Jdl.Android.csproj

@mkoertgen
Copy link
Contributor

I believe that @gabri705 issue is not related to this.

Anyway, libgitsharp released a new prerelease which i'm gonna testing today

@mkoertgen
Copy link
Contributor

mkoertgen commented Oct 2, 2016

After updating 2 tests were breaking which seemed to be related to proxy settings. In a proxy-less environment, they run fine. The PR build failed because master evolved meanwhile and a merge was needed. Just did that and PR #1024 should now be ready to be merged in. Sorry, for the long delay.

@mkoertgen
Copy link
Contributor

mkoertgen commented Oct 11, 2016

The Travis CI build still fails at 1 test, i.e.

I am not sure how i can contribute in stabilizing the build to get this issue fixed. Any suggestions @JakeGinnivan ?

@roryprimrose
Copy link

This hits me when I have two different versions of GitVersionTask in the solution packages folder. Closing VS2015 then wiping out both GitVersionTask packages (plus any other packages that have duplicates), open and rebuild. This ensures that the packages folder now only contains the versions that should be there after nuget has restored the current references. Problem solved.

@forestb
Copy link

forestb commented Nov 1, 2016

I stumbled across this thread while searching for some insight to this problem. I believe the problem may be as @roryprimrose indicated. I have a solution where several projects were referencing 3.6.2 and several were referencing 3.6.4. However restarting Visual Studio (2015, in this case) did not help, and it seemed to affect completely unrelated solutions/different repositories.

Looking for the culprit, I noticed MSBuild.exe and MSBuildTaskHost.exe were still running under my Windows processes, despite closing Visual Studio and no longer building anymore. I force-killed those processes, ensured all my GitVersionTask library versions matched in the solution, and no longer experience the problem.

As long as any projects had mismatched versions (at least the two versions specified above), I was able to consistently reproduce the problem.

@asbjornu
Copy link
Member

asbjornu commented Nov 1, 2016

@forestb, @roryprimrose: If what your experiences are infact the solution to this problem, that would be awesome. Ideas on how we can automate a check for different versions of GitVersion in the same solution?

@mkoertgen: I think I have identified the problem with the test in GitTools/GitTools.Core#38. As soon as that's merged, released and upgraded in GitVersion, I hope we can get rid of this and the problem @cvpcs is having in #1070.

@jbaehr
Copy link
Contributor

jbaehr commented Feb 20, 2018

Today I ran into the same issue. Two instances of Visual Studio, each building unrelated sources from different git repos. Unfortunately at the same time on the same machine.
On one side I have GitVersion-3.6.5, on the other GitVersion-4.0.0-beta12. As soon as I close one instance, the other works again; no matter in which order. This means, the v4-beta12 breaks when a v3.6.5 ran, and the other way round, too.

@threegerbils
Copy link

This issue could be related to a CoreCLR bug: https://github.com/dotnet/coreclr/issues/19654

@asbjornu
Copy link
Member

Seems like dotnet/Nerdbank.GitVersioning#216 might be worth looking at.

@asbjornu
Copy link
Member

After upgrading to LibGit2Sharp version 0.26 in #1713, this problem might be fixed. Can you please try the latest build and report back whether it fixes this problem or not? Please reopen this issue if the problem persists.

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