Closed Apholisha closed 10 months ago
Hello, Any progress on this? Thanks.
Hi,
I started seeing this on my builds since this morning. Have multiple .Net 3.1 applications, build pipeline specifies
TargetFramework : 'netcoreapp3.1', but get this same error /usr/share/dotnet/sdk/6.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.ConflictResolution.targets(112,5): error NETSDK1152: Found multiple publish output files with the same relative path: <list of random project appsettings.json and appsettings.Development.json files>
I worked around it by adding ErrorOnDuplicatePublishOutputFiles property to each of my projects, even though this is a property introduced in .Net 6 (https://docs.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props#erroronduplicatepublishoutputfiles)
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles>
</PropertyGroup>
Build succeeded after this
This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days
Stay fresh please bot
I'm also having this issue in my cloud-hosted agents.
Incredible how such an issue is completely ignored with no word from the team.
This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days
Not stale.
I just encountered this issue when trying to redeploy my freshly broken Blazor app. UseDotNet@2 had installed 7.0.302 (many regressions). So I specified 7.0.203 in UseDotNet, but VSBuild@1 still builds with 7.0.302. I had to delete 302 from C:\agent\_work\_tool\dotnet\sdk
on my agent machine.
Addendum: My global.json was not set up correctly. I was allowing rollForward versions to latestMajor, which caused VSBuild@1 to use the latest installed patch (which was installed previously by UseDotNet@2). Regardless, the description of UseDotNet@2 stating that it enforces the version used "in subsequent tasks" is misleading since the global.json has final say.
This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days
Question, Bug, or Feature?
Type: Bug
Enter Task Name: Use .NET Core
Environment
Azure Pipelines
Agent - Private:
Issue Description
Use .NET Core installs a .Net Core version, but that version is not what used in the subsequent tasks.
We have numerous projects that are using different versions of .Net Core ( 3.1, 5.0, 6.0) . The Task does indeed make sure the requested version is installed in the _work\tools folder.
Problem is that after that the highest available version is picked up. On almost all agents in our pool this is now 6.0.
The projects are not meant to be build with 6.0. For puild that is not a problem, but on publish the task fails with " error NETSDK1152: Found multiple publish output files with the same relative path". The error is because of a breaking change that was introduced with 6.0 .
We are failing to enforce version 3.1 or 5.0 for the publish step.
Task logs
2021-12-06T12:40:55.0033158Z ##[section]Starting: Use .NET Core sdk 3.1.100 2021-12-06T12:40:55.0257291Z ============================================================================== 2021-12-06T12:40:55.0257683Z Task : Use .NET Core 2021-12-06T12:40:55.0258139Z Description : Acquires a specific version of the .NET Core SDK from the internet or the local cache and adds it to the PATH. Use this task to change the version of .NET Core used in subsequent tasks. Additionally provides proxy support. 2021-12-06T12:40:55.0258556Z Version : 2.195.0 2021-12-06T12:40:55.0258755Z Author : Microsoft Corporation 2021-12-06T12:40:55.0258960Z Help : https://aka.ms/AA4xgy0 2021-12-06T12:40:55.0259194Z ============================================================================== 2021-12-06T12:40:55.3799912Z Tool to install: .NET Core sdk version 3.1.100. 2021-12-06T12:40:58.1895476Z Found version 3.1.100 in channel 3.1 for user specified version spec: 3.1.100 2021-12-06T12:40:58.2340128Z Version: 3.1.100 was found in cache. 2021-12-06T12:40:58.2348659Z Creating global tool path and pre-pending to PATH. 2021-12-06T12:40:58.2371081Z ##[section]Finishing: Use .NET Core sdk 3.1.100
Troubleshooting
I trying uninstalling the .net 6.0 that comes with the VS Build tools installed on the agents, but as people can use the task to install 6.0 in the agent work folder, I cannot completely remove the version from the agent.
I've found a workaround. With a PowerShell script I create a temporary global.json file in the '$(System.DefaultWorkingDirectory)' using
dotnet new globaljson --sdk-version 3.1.100 --force
But we have 10+ projects and now I have to add this to every pipeline.
Error logs