-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Dotnet pack injecting buildProperties into target project path #16728
Comments
Same issue |
Same for us. All of a sudden dotnet pack tasks fail in our pipelines. We're using the task pretty much the same as @mendoncaftw. Comman according to logs: Error message: |
Potentially related to dotnet/sdk#27059. I don't think I can use their suggested workaround because of the code on this line:
|
Same problem here. Even with only one item in the buildProperties, the config property was injected in the path, thus giving an error saying it could not find the fil. We had to downgrade and specify the sdk version 6.0.302, for the moment... |
This is a big issue for us as well. When specifying versions using buildProperties they get added to the configuration, leading to failed builds. - task: DotNetCoreCLI@2
inputs:
command: pack
configuration: $(buildConfiguration)
packagesToPack: '**/*.csproj'
buildProperties: 'InformationalVersion=0.0.0-dev+?.?' We are passing other properties as well, I have shortened it to illustrate the issue.
Starting with dotnet sdk 6.0.400 this will then pass the full string as the configuration string, leading to the following output path:
In our specific case this will fail because of the question marks in the path. In other cases it may pass but these properties should definitely not be part of the build configuration. So is the dotnet sdk behaving more correct now and should the DotNetCoreCLI task be fixed or is this a regression in the dotnet sdk? Sidenote: |
Contrary to the documentation the But you can use a global.json file as described here: |
I just set the SDK version before i build or pack.
|
If that works for you, fine, but this actually only downloads the SDK if it's not already cached. Running |
I just noticed the issue in the dotnet sdk (dotnet/sdk#27059) has actually already been resolved in this PR: dotnet/sdk#27086. |
Not sure if 6.0.401 is on the windows hosted agents yet, but the docs still say 6.0.400. |
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: DotNetCoreCLI@2
Environment
Server - Azure Pipelines
Agent - Hosted:
Issue Description
From yesterday to today, dotnet pack tasks have started to fail in all of my projects pipelines. On the logs the emphasis is mine. The task somehow is injecting the buildProperties PackageVersion into the pack target project path. This started happening today on all our projects that have the same steps, just changing the project name.
Task logs
Starting: dotnet pack
Task : .NET Core
Description : Build, test, package, or publish a dotnet application, or run a custom dotnet command
Version : 2.202.0
Author : Microsoft Corporation
Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/build/dotnet-core-cli
/opt/hostedtoolcache/dotnet/dotnet pack /home/vsts/work/1/s/src/project_name/project_name.csproj --output /home/vsts/work/1/a --no-build --include-symbols /p:Configuration=Release;PackageVersion=0.12.24 --verbosity Minimal
MSBuild version 17.3.0+92e077650 for .NET
/opt/hostedtoolcache/dotnet/sdk/6.0.400/Sdks/NuGet.Build.Tasks.Pack/build/NuGet.Build.Tasks.Pack.targets(221,5): error NU5026: The file '/home/vsts/work/1/s/src/project_name/bin/Release;PackageVersion=0.12.24/net6.0/project_name.dll' to be packed was not found on disk. [/home/vsts/work/1/s/src/project_name/project_name.csproj]
##[warning].NET 5 has some compatibility issues with older Nuget versions(<=5.7), so if you are using an older Nuget version(and not dotnet cli) to restore, then the dotnet cli commands (e.g. dotnet build) which rely on such restored packages might fail. To mitigate such error, you can either: (1) - Use dotnet cli to restore, (2) - Use Nuget version 5.8 to restore, (3) - Use global.json using an older sdk version(<=3) to build
##[error]Error: The process '/opt/hostedtoolcache/dotnet/dotnet' failed with exit code 1
##[error]An error occurred while trying to pack the files.
Info: Azure Pipelines hosted agents have been updated and now contain .Net 5.x SDK/Runtime along with the older .Net Core version which are currently lts. Unless you have locked down a SDK version for your project(s), 5.x SDK might be picked up which might have breaking behavior as compared to previous versions. You can learn more about the breaking changes here: https://docs.microsoft.com/en-us/dotnet/core/tools/ and https://docs.microsoft.com/en-us/dotnet/core/compatibility/ . To learn about more such changes and troubleshoot, refer here: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/build/dotnet-core-cli?view=azure-devops#troubleshooting
Finishing: dotnet pack
The text was updated successfully, but these errors were encountered: