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

macOS Build: "The 'Microsoft.Build.Tasks.Git.LocaleteRepository" task failed unexpectedly #178

Closed
maurei opened this issue Sep 27, 2018 · 8 comments

Comments

@maurei
Copy link

maurei commented Sep 27, 2018

Occured when building this repo

Using Visual studio for Mac (Community) 7.6.7 (build 49)

my environment:

.NET Core SDK (reflecting any global.json):
 Version:   2.1.402
 Commit:    3599f217f4

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.13
 OS Platform: Darwin
 RID:         osx.10.13-x64
 Base Path:   /usr/local/share/dotnet/sdk/2.1.402/

Host (useful for support):
  Version: 2.1.4
  Commit:  85255dde3e

.NET Core SDKs installed:
  2.0.0 [/usr/local/share/dotnet/sdk]
  2.1.4 [/usr/local/share/dotnet/sdk]
  2.1.302 [/usr/local/share/dotnet/sdk]
  2.1.402 [/usr/local/share/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.4 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.4 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.0.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.2 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download

The error:

 The "Microsoft.Build.Tasks.Git.LocateRepository" task failed unexpectedly.
 System.TypeInitializationException: The type initializer for 'Microsoft.Build.Tasks.Git.TaskImplementation' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Build.Tasks.Git.Operations' or one of its dependencies
   at System.AppDomain.Load (System.Reflection.AssemblyName assemblyRef, System.Security.Policy.Evidence assemblySecurity) [0x001a9] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-02/external/bockbuild/builds/mono-x64/mcs/class/corlib/System/AppDomain.cs:777 
   at (wrapper remoting-invoke-with-check) System.AppDomain.Load(System.Reflection.AssemblyName,System.Security.Policy.Evidence)
   at System.AppDomain.Load (System.Reflection.AssemblyName assemblyRef) [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-02/external/bockbuild/builds/mono-x64/mcs/class/corlib/System/AppDomain.cs:714 
   at (wrapper remoting-invoke-with-check) System.AppDomain.Load(System.Reflection.AssemblyName)
   at System.Reflection.Assembly.Load (System.Reflection.AssemblyName assemblyRef) [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-02/external/bockbuild/builds/mono-x64/mcs/class/corlib/System.Reflection/Assembly.cs:600 
   at Microsoft.Build.Tasks.Git.TaskImplementation..cctor () [0x0006b] in /_/src/Microsoft.Build.Tasks.Git/TaskImplementation.cs:32 
    --- End of inner exception stack trace ---
   at Microsoft.Build.Tasks.Git.LocateRepository.Execute () [0x0000f] in /_/src/Microsoft.Build.Tasks.Git/LocateRepository.cs:27 
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00023] in /_/src/Build/BackEnd/TaskExecutionHost/TaskExecutionHost.cs:631 
   at Microsoft.Build.BackEnd.TaskBuilder+<ExecuteInstantiatedTask>d__26.MoveNext () [0x00212] in /_/src/Build/BackEnd/Components/RequestBuilder/TaskBuilder.cs:787 
Done building project "JsonApiDotNetCore.csproj" -- FAILED.
@Cheesebaron
Copy link
Contributor

Cheesebaron commented Oct 23, 2018

This is also happening when trying to build MvvmCross on macOS although the stack trace seems to be a bit different:

The "Microsoft.Build.Tasks.Git.LocateRepository" task failed unexpectedly.
System.BadImageFormatException: Method has no body
File name: 'LibGit2Sharp'
  at LibGit2Sharp.Core.Proxy.git_buf_free (LibGit2Sharp.Core.Handles.GitBuf buf) [0x00000] in <06ab184b4ccd4259a7a7af2756f77645>:0 
  at LibGit2Sharp.Core.Handles.GitBuf.Dispose () [0x00000] in <06ab184b4ccd4259a7a7af2756f77645>:0 
  at LibGit2Sharp.Core.Proxy.ConvertPath (System.Func`2[T,TResult] pathRetriever) [0x0002e] in <06ab184b4ccd4259a7a7af2756f77645>:0 
  at LibGit2Sharp.Core.Proxy.git_repository_discover (LibGit2Sharp.Core.FilePath start_path) [0x00005] in <06ab184b4ccd4259a7a7af2756f77645>:0 
  at LibGit2Sharp.Repository.Discover (System.String startingPath) [0x00006] in <06ab184b4ccd4259a7a7af2756f77645>:0 
  at Microsoft.Build.Tasks.Git.GitOperations.LocateRepository (System.String directory) [0x00000] in /_/src/Microsoft.Build.Tasks.Git.Operations/GitOperations.cs:24 
  at Microsoft.Build.Tasks.Git.RepositoryTasks.LocateRepository (Microsoft.Build.Tasks.Git.LocateRepository task) [0x00000] in /_/src/Microsoft.Build.Tasks.Git.Operations/RepositoryTasks.cs:50 
  at Microsoft.Build.Tasks.Git.LocateRepository.Execute () [0x00038] in /_/src/Microsoft.Build.Tasks.Git/LocateRepository.cs:32 
  at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00023] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-06/external/bockbuild/builds/msbuild-15/src/Build/BackEnd/TaskExecutionHost/TaskExecutionHost.cs:573 
  at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask (Microsoft.Build.BackEnd.ITaskExecutionHost taskExecutionHost, Microsoft.Build.BackEnd.Logging.TaskLoggingContext taskLoggingContext, Microsoft.Build.BackEnd.TaskHost taskHost, Microsoft.Build.BackEnd.ItemBucket bucket, Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask) [0x001f6] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-06/external/bockbuild/builds/msbuild-15/src/Build/BackEnd/Components/RequestBuilder/TaskBuilder.cs:784 

@Nickolas-
Copy link

@Cheesebaron did you found workaround for right now ?

@maurei
Copy link
Author

maurei commented Oct 28, 2018

@Nickolas- I just removed the dependency and it worked fine again.

@MisterJimson
Copy link

Running into this as well. Pretty much same environment as above. Tried on 2.1.302 and 2.1.403

@Ivan-L
Copy link

Ivan-L commented Nov 15, 2018

Also running into this when using the Microsoft.SourceLink.Bitbucket.Git package, version 1.0.0-beta-63127-02 in my own project and building my project on a Mac.

System.TypeInitializationException: The type initializer for 'Microsoft.Build.Tasks.Git.TaskImplementation' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Build.Tasks.Git.Operations' or one of its dependencies
  at System.AppDomain.Load (System.Reflection.AssemblyName assemblyRef, System.Security.Policy.Evidence assemblySecurity) [0x001a9] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-02/external/bockbuild/builds/mono-x64/mcs/class/corlib/System/AppDomain.cs:777 
  at (wrapper remoting-invoke-with-check) System.AppDomain.Load(System.Reflection.AssemblyName,System.Security.Policy.Evidence)
  at System.AppDomain.Load (System.Reflection.AssemblyName assemblyRef) [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-02/external/bockbuild/builds/mono-x64/mcs/class/corlib/System/AppDomain.cs:714 
  at (wrapper remoting-invoke-with-check) System.AppDomain.Load(System.Reflection.AssemblyName)
  at System.Reflection.Assembly.Load (System.Reflection.AssemblyName assemblyRef) [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-02/external/bockbuild/builds/mono-x64/mcs/class/corlib/System.Reflection/Assembly.cs:600 
  at Microsoft.Build.Tasks.Git.TaskImplementation..cctor () [0x0006b] in /_/src/Microsoft.Build.Tasks.Git/TaskImplementation.cs:32 
   --- End of inner exception stack trace ---
  at Microsoft.Build.Tasks.Git.LocateRepository.Execute () [0x0000f] in /_/src/Microsoft.Build.Tasks.Git/LocateRepository.cs:27 
  at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00023] in /_/src/Build/BackEnd/TaskExecutionHost/TaskExecutionHost.cs:631 
  at Microsoft.Build.BackEnd.TaskBuilder+<ExecuteInstantiatedTask>d__26.MoveNext () [0x00212] in /_/src/Build/BackEnd/Components/RequestBuilder/TaskBuilder.cs:787 

.NET Core version is 2.1.400.

@tmat
Copy link
Member

tmat commented Dec 22, 2018

Fixed in version 1.0.0-beta2-18618-05.

@tmat tmat closed this as completed Dec 22, 2018
@bruno-garcia
Copy link
Member

@tmat I can still reproduce with version 1.0.0-beta2-18618-05.

A repro is basically master from https://github.com/getsentry/sentry-dotnet, update Microsoft.SourceLink.GitHub to said version and the error is there. That is, using Rider (Mono), the build script using .NET Core works fine.

Haven't been able to work with Rider on a macOS for a while if I have Microsoft.SourceLink.GitHub installed.

@tmat
Copy link
Member

tmat commented Jan 7, 2019

If you're building on Mono that's a different issue: #155

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

7 participants