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

Installing .net 6 is required for 5.0 projects and when installing this version the build agent on the same machine fails to build due to error #3532

Closed
marcpopMSFT opened this issue Jul 22, 2021 · 11 comments

Comments

@marcpopMSFT
Copy link

This was copied from https://developercommunity.visualstudio.com/t/Installing-net-6-is-required-for-50-pr/1474894

When I have the latest version of the preview 2022 I cannot use the build agent on my machine for devops. I recieve the error below in the pipeline. If I on the other hand uninstall .net 6.0 the pipeline runs smoothly. The installer tells me I still have 5.0 installed but the project with .net 5.0 version cannot be opened and visual studio suggests that I should install some packages. After installation I end up in the same situation where the build agent pipeline fails meanwhile the project can be opened again.

"

##[error]Error: The process ‘C:\Program Files\dotnet\dotnet.exe’ failed with exit code 1

##[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

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

##[error]Dotnet command failed with non-zero exit code on the following projects : …

@tang2087
Copy link

This issue is now impacting my dotnet 5 publish where I have used by .NET 5 and 3 SDK. The version 3 SDK is required unfortunately for .NET 5 based Azure V3 functions...

@anatolybolshakov anatolybolshakov transferred this issue from microsoft/azure-pipelines-tasks Sep 13, 2021
@ghost ghost added bug question and removed triage labels Sep 14, 2021
@ghost ghost self-assigned this Sep 15, 2021
@ghost
Copy link

ghost commented Sep 15, 2021

Hello, @FahaoTang could you please provide error logs or repro steps for your issue?

@tang2087
Copy link

tang2087 commented Sep 17, 2021

Hello, @FahaoTang could you please provide error logs or repro steps for your issue?

The steps to reproduce:

  • Create a solution in VS2019
  • Add an .NET 5 based website project
  • Add an .NET 5 based (.NET worker) Azure Functions project using Blob trigger
  • Submit the code to a Azure DevOps repo
  • Create a standard build plan in Azure DevOps using .NET Core website template.
  • Add task to use .NET SDK 3.1.x which is unfortunately required by .NET 5 based Azure V3 functions.
  • Then run the build pipeline.
    This has been working really well for me all the time since early this year and from last week the error started to occur.

I eventually resolved the issue by separate Azure Functions build into another pipeline and my website build pipeline only build the website project. It's working but the pipeline time has increased from 6-7 mins to almost 20 mins ( due to npm install command now runs longer).

@EzzhevNikita EzzhevNikita assigned EzzhevNikita and unassigned ghost Sep 30, 2021
@EzzhevNikita
Copy link
Contributor

Hello @FahaoTang,
I have investigated this issue. And it looks like not related to build agent. Most likely it's related to installing of Visual Studio 2022 preview and .NET 6 preview or RC version. Update of some SDKs, components or tools installed on machine can require update of other software to keep compatibility between them.
I see in description of occurred error that root cause is non-compatible version of NuGet manager. Actual version of .NET require NuGet manager version 5.8 or newer.
Please try to update version of NuGet manager by one of following ways:

@tang2087
Copy link

tang2087 commented Oct 2, 2021

Hello @FahaoTang, I have investigated this issue. And it looks like not related to build agent. Most likely it's related to installing of Visual Studio 2022 preview and .NET 6 preview or RC version. Update of some SDKs, components or tools installed on machine can require update of other software to keep compatibility between them. I see in description of occurred error that root cause is non-compatible version of NuGet manager. Actual version of .NET require NuGet manager version 5.8 or newer. Please try to update version of NuGet manager by one of following ways:

Thanks for the suggestions.

@EzzhevNikita
Copy link
Contributor

@FahaoTang, please notify us about the results, and let us know if you need additional help.

@tang2087
Copy link

tang2087 commented Oct 4, 2021

@FahaoTang, please notify us about the results, and let us know if you need additional help.

Hello, I am using Azure DevOps to build and the agent I used is windows-2022 with NuGet 5.11.0.10 already.
https://github.com/actions/virtual-environments/blob/main/images/win/Windows2022-Readme.md

Note: my previous error was not caused by different dependent SDKs; it was because Node.js issue (times out I guess) when building in that agent. After I commented out the node.js actions in Publish step, my build has always been successful. Apologies my original comment may have caused confusion.

@EzzhevNikita
Copy link
Contributor

@FahaoTang, thank you for this info.
Could you please confirm that your pipelines aren't affected by issue described in first message now? Please let us know if the ticket can be closed in this case.
If no, please share us details about environment used to repro this issue, YAML of affected pipeline and logs of failed run (with enabled "Enable system diagnostics").

@tang2087
Copy link

tang2087 commented Oct 4, 2021

I didn't raise the original issue thus would not be able to confirm that. I can confirm my previous issue was resolved by removing Node.js build task from publish task in my Azure DevOps build pipeline. The error message is the same but I don't think it was caused by Nuget version related issue.

@EzzhevNikita
Copy link
Contributor

This issue is not related to agent itself, most likely this is environment-specific. And there is no new repro.
So the ticket is closed.

@askshaik
Copy link

askshaik commented Sep 9, 2022

I am also getting the same error and I followed the above-suggested step but error is still prevailing

For switch syntax, type "MSBuild -help"
##[error]Error: The process '/usr/bin/dotnet' failed with exit code 1
##[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
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
##[error]Dotnet command failed with non-zero exit code on the following projects : /home/vsts/work/1/s/Sempra.ADF.AzureFunctions/Sempra.ADF.AzureFunctions.csproj
Finishing: DotNetCoreCLI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants