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

The "Microsoft.Build.Tasks.Git.LocateRepository" task failed unexpectedly. System.InvalidCastException #1007

Closed
maraf opened this issue Apr 21, 2023 · 2 comments
Labels
duplicate This issue or pull request already exists

Comments

@maraf
Copy link
Member

maraf commented Apr 21, 2023

Hitting this error in SDK build 247607

.dotnet/sdk/8.0.100-preview.4.23220.14/Sdks/Microsoft.Build.Tasks.Git/build/Microsoft.Build.Tasks.Git.targets(26,5): error MSB4018: (NETCORE_ENGINEERING_TELEMETRY=Build) The "Microsoft.Build.Tasks.Git.LocateRepository" task failed unexpectedly.
System.InvalidCastException: [A]System.Runtime.CompilerServices.StrongBox`1[Microsoft.Build.Tasks.Git.GitRepository] cannot be cast to [B]System.Runtime.CompilerServices.StrongBox`1[Microsoft.Build.Tasks.Git.GitRepository]. Type A originates from 'System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' in the context 'Default' at location '/mnt/vss/_work/1/s/.dotnet/shared/Microsoft.NETCore.App/8.0.0-preview.4.23220.4/System.Private.CoreLib.dll'. Type B originates from 'System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' in the context 'Default' at location '/mnt/vss/_work/1/s/.dotnet/shared/Microsoft.NETCore.App/8.0.0-preview.4.23220.4/System.Private.CoreLib.dll'.
   at Microsoft.Build.Tasks.Git.RepositoryTask.TryGetCachedRepositoryInstance(String cacheKey, Boolean requireCached, GitRepository& repository)
   at Microsoft.Build.Tasks.Git.RepositoryTask.GetOrCreateRepositoryInstance()
   at Microsoft.Build.Tasks.Git.RepositoryTask.ExecuteImpl()
   at Microsoft.Build.Tasks.Git.RepositoryTask.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)
@tmat
Copy link
Member

tmat commented Apr 21, 2023

@rainersigwald

@tmat
Copy link
Member

tmat commented Apr 21, 2023

Seems like the same as dotnet/msbuild#8478

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants