Building a .NET Core 3.1 project results in MSB4062
See original GitHub issueHi,
After upgrading my solution to .NET Core 3.1, I’ve started to notice that my builds are failing due to sourcelink? Can anyone elaborate on what the issue is, and can I work around this in any way?
Core.Serialization.csproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<LangVersion>8.0</LangVersion>
<OutputType>library</OutputType>
<IsPackable>true</IsPackable>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<PackageReference Include="protobuf-net" Version="2.4.0" />
<PackageReference Include="Microsoft.SourceLink.Vsts.Git" Version="1.0.0-beta2-19367-01" PrivateAssets="All" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\core-pkg\src\Core\Core.csproj" />
</ItemGroup>
</Project>
Build output
error MSB4062: The "Microsoft.Build.Tasks.Git.LocateRepository"
task could not be loaded from the assembly
/root/.nuget/packages/microsoft.build.tasks.git/1.0.0-beta2-19367-01/build/../tools/netcoreapp2.0/Microsoft.Build.Tasks.Git.dll.
Assembly with same name is already loaded Confirm that the
<UsingTask> 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
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
dotnet build command - .NET CLI
The dotnet build command builds a project and all of its dependencies.
Read more >Announcing .NET Core 3.1
Announcing .NET Core 3.1. We're excited to announce the release of .NET Core 3.1. It's really just a small set of fixes and...
Read more >Problems when building Uno Platform project from ...
1 Answer 1 ·.NET Core 2 was just something I was trying out to see if that worked. · In this case, you...
Read more >Episode 1: Creating a new .NET Core 3.1 Project - YouTube
Development on Request Metrics begins! Before we can write any fun, (hopefully) money making code, we need to get some unexciting ground ...
Read more >c# - .NET Core 2 build is not working in .NET Core 3.1
I have a build server that has .NET Core 2.2.110 installed in it. For my new application, I need .NET Core 3.1. So...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@tillig had you previously built a solution that used a different version of
Microsoft.Build.Tasks.Git
? This partcould be explained by MSBuild node reuse: newly-created nodes can load the 1.0.0 version fine; older ones had a different version loaded and failed.
Prior to .NET Core SDK 3.1.200 (not yet released), MSBuild could only load one version of an assembly in the lifetime of the process. By default, worker nodes live past the build invocation that created them. This is a bad combination! But should be fixed in the future by https://github.com/microsoft/msbuild/pull/4916.
@rainersigwald That would explain. Thanks!