Open jswapneswar opened 7 months ago
Adding screenshots here for reference.
Hi @jswapneswar, can you please provide steps to reproduce your issue? Do you use YML pipelines? If so, can you share the yml file of your pipeline?
I see the MSBuild error on the screenshot, MSBUILD : error MSB1008: Only one project can be specified
.
So, can you please share the full command line?
No, I used classic editor to create this CI, and this repo has one solution file and multiple csprojs. but I want to build one project out of all. So, when I try to build and it doesn't work, I'll send you a screenshot of the steps that I took. is it ok for you ?
First, I tried to install it. Net 7.0.x to build and run, and then restore and then build. In build, I am getting this issue, and I don't know how to solve it.
@jswapneswar can you please also enable debug logs (by setting system.debug
pipeline variable to true
) and share debug logs for the Build
pipeline step (as text, not a screenshot)?
Hi @DenisRumyantsev here are the debug logs for build step as you asked . Thank you
C:\hostedtoolcache\windows\dotnet\dotnet.exe build D:\a\1\s\src\Integrations.Services.Configuration.API "-dl:CentralLogger,\"D:\a_tasks\DotNetCoreCLI_5541a522-603c-47ad-91fc-a4b1d163081b\2.235.0\dotnet-build-helpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll\"ForwardingLogger,\"D:\a_tasks\DotNetCoreCLI_5541a522-603c-47ad-91fc-a4b1d163081b\2.235.0\dotnet-build-helpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll\"" --project $ (BuildConfiguration) MSBuild version 17.7.4+3ebbd7c49 for .NET MSBUILD : error MSB1001: Unknown switch. Full command line: 'C:\hostedtoolcache\windows\dotnet\sdk\7.0.405\MSBuild.dll -maxcpucount -verbosity:m -restore -consoleloggerparameters:Summary D:\a\1\s\src\Integrations.Services.Configuration.API -dl:CentralLogger,"D:\a_tasks\DotNetCoreCLI_5541a522-603c-47ad-91fc-a4b1d163081b\2.235.0\dotnet-build-helpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll"ForwardingLogger,"D:\a_tasks\DotNetCoreCLI_5541a522-603c-47ad-91fc-a4b1d163081b\2.235.0\dotnet-build-helpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll" --project $ (BuildConfiguration) -distributedlogger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,C:\hostedtoolcache\windows\dotnet\sdk\7.0.405\dotnet.dll*Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingLogger,C:\hostedtoolcache\windows\dotnet\sdk\7.0.405\dotnet.dll' Switches appended by response files: Switch: --project
For switch syntax, type "MSBuild -help"
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: Build
Hi @DenisRumyantsev I got to know that it was using a different SDK runtime version to build this project. I added perform multilookup to true, but it was installing the 7.X version. While building,but it was taking the 5.X version. So how do I lock or provide the correct version to build this project? I enabled global. json also, but it's not in my project. Is there any other way to restrict the versions?
Hi @DenisRumyantsev any luck ?
Hello, I encountered a similar issue. It seems that the target framework in my .csproj was not matching what I had specified to in my yaml file. Upon changing them to a similar framework, the build and tests ran to completion. Try changing matching them and see if the build is successful.
Hi @DenisRumyantsev I got to know that it was using a different SDK runtime version to build this project. I added perform multilookup to true, but it was installing the 7.X version. While building,but it was taking the 5.X version. So how do I lock or provide the correct version to build this project? I enabled global. json also, but it's not in my project. Is there any other way to restrict the versions?
Task name
Dotnet Build
Task version
.*2
Environment type (Please select at least one enviroment where you face this issue)
Azure DevOps Server type
dev.azure.com (formerly visualstudio.com)
Azure DevOps Server Version (if applicable)
Azure devops
Operation system
Windwos 2019 , latest
Question