Error MSB4062: "Microsoft.Build.Tasks.Git.LocateRepository" task could not be loaded
- Dominant language
- C#
- Stars
- 1.4k
- Forks
- 148
- PR merge metrics
- No merged PRs in 30d
Description
After switching from
Microsoft.SourceLink.Tfs.Git Version="1.0.0-beta2-19367-01"
to
Microsoft.SourceLink.AzureDevOpsServer.Git Version="1.0.0"
I get randomly this error on the build agent:
C:\Users\builduser\.nuget\packages\microsoft.build.tasks.git\1.0.0\build\Microsoft.Build.Tasks.Git.targets(24,5): error MSB4062: The "Microsoft.Build.Tasks.Git.LocateRepository" task could not be loaded from the assembly C:\Users\builduser\.nuget\packages\microsoft.build.tasks.git\1.0.0\build\..\tools\netcoreapp2.0\Microsoft.Build.Tasks.Git.dll. Assembly with same name is already loaded Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. [Z:\w\35\s\Source\MyProject1\MyProject1.csproj]
C:\Users\builduser\.nuget\packages\microsoft.build.tasks.git\1.0.0\build\Microsoft.Build.Tasks.Git.targets(24,5): error MSB4062: The "Microsoft.Build.Tasks.Git.LocateRepository" task could not be loaded from the assembly C:\Users\builduser\.nuget\packages\microsoft.build.tasks.git\1.0.0\build\..\tools\netcoreapp2.0\Microsoft.Build.Tasks.Git.dll. Assembly with same name is already loaded Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. [Z:\w\35\s\Source\MyProject2\MyProject2.csproj]
Build FAILED.
It looks like the new version can not handle, if multiple projects in one solution have sourcelink included. With the old version I have never seen this error.
Csproj:
```xml
netstandard2.0
MyProject2
MyProject2
true
0.0.0.9999
0.0.0.9999
true
$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb
true
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.