Build/Test Issues

Cannot build Azure Function having reference to Microsoft.Azure.Functions.Worker.Sdk 1.17.3

Started by arkiaconsulting on 4,514 views

Ncrunch is unable to build an Azure Function (net 8 isolated) when it references Microsoft.Azure.Functions.Worker.Sdk with version 1.17.3 or 1.17.4. Here is the error:

C:\Program Files\dotnet\sdk\8.0.400-preview.0.24324.5\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets: Assets file 'D:\NCrunchWorkspace\26516\20\xxx\src\AzureFunction\obj\project.assets.json' doesn't have a target for 'net6.0'. Ensure that restore has run and that you have included 'net6.0' in the TargetFrameworks for your project.


It works fine when downgrading the package Microsoft.Azure.Functions.Worker.Sdk to 1.17.2

NCrunch VS2022 5.9.0.1

Edited

Thanks for sharing this. Do you have a sample project you can share with me that can produce this issue? You can submit this to me in ZIP form through the NCrunch support contact form.
@Remco. Thanks ! done

Edited

Thanks for sending through the sample project. I've reproduced this problem in the way you've described it.

The issue is caused by a nested build that happens inside the build of this project. Normally, we shut this off as it isn't required for NCrunch and just gives us trouble. Unfortunately, there is no clearly designed 'off' switch for the build steps involved, so we need to reach into the internals of the build system and shut down the targets specifically.

In v1.17.2, MS changed the build system significantly and the targets we are shutting down have changed, so to fix this I'll need to get you a new build. I'll let you know as soon as we have one available.
Would you be interested in trying the build below, and letting me know if it solves the issue for you?

NCrunch_Console_5.10.0.1.msi
NCrunch_Console_5.10.0.1.zip
NCrunch_GridNodeServer_5.10.0.1.msi
NCrunch_GridNodeServer_5.10.0.1.zip
NCrunch_LicenseServer_5.10.0.1.zip
NCrunch_Rider_5.10.0.1.7z
NCrunch_Rider_5.10.0.1.zip
NCrunch_VS2010_5.10.0.1.msi
NCrunch_VS2010_5.10.0.1.zip
NCrunch_VS2012_5.10.0.1.msi
NCrunch_VS2012_5.10.0.1.zip
NCrunch_VS2013_5.10.0.1.msi
NCrunch_VS2013_5.10.0.1.zip
NCrunch_VS2015_5.10.0.1.msi
NCrunch_VS2015_5.10.0.1.msi.7z
NCrunch_VS2015_5.10.0.1.zip
NCrunch_VS2017_5.10.0.1.msi
NCrunch_VS2017_5.10.0.1.msi.7z
NCrunch_VS2017_5.10.0.1.zip
NCrunch_VS2019_5.10.0.1.msi
NCrunch_VS2019_5.10.0.1.msi.7z
NCrunch_VS2019_5.10.0.1.zip
NCrunch_VS2022_5.10.0.1.msi
NCrunch_VS2022_5.10.0.1.msi.7z
NCrunch_VS2022_5.10.0.1.zip
Thanks @Remco.

I just tested with the 5.10.0.1 with success.

As I side note, I also tested this NCrunch version with the version 1.17.0 of the Microsoft.Azure.Functions.Worker.Sdk package, and I got the following build error:


..\..\..\..\program files\microsoft visual studio\2022\preview\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets (5321, 5): Could not copy the file "D:\NCrunchWorkspace\46204\7\FunctionApp1\obj\Debug\net8.0\functions.metadata" because it was not found.
..\..\..\..\program files\microsoft visual studio\2022\preview\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets (5321, 5): Could not copy the file "D:\NCrunchWorkspace\46204\7\FunctionApp1\obj\Debug\net8.0\worker.config.json" because it was not found.
..\..\..\..\program files\microsoft visual studio\2022\preview\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets (5321, 5): Could not copy the file "D:\NCrunchWorkspace\46204\7\FunctionApp1\obj\Debug\net8.0\extensions.json" because it was not found.


That could be an issue for those of us who cannot easily upgrade their packages.
arkiaconsulting wrote:Thanks @Remco.

I just tested with the 5.10.0.1 with success.

As I side note, I also tested this NCrunch version with the version 1.17.0 of the Microsoft.Azure.Functions.Worker.Sdk package, and I got the following build error:


..\..\..\..\program files\microsoft visual studio\2022\preview\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets (5321, 5): Could not copy the file "D:\NCrunchWorkspace\46204\7\FunctionApp1\obj\Debug\net8.0\functions.metadata" because it was not found.
..\..\..\..\program files\microsoft visual studio\2022\preview\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets (5321, 5): Could not copy the file "D:\NCrunchWorkspace\46204\7\FunctionApp1\obj\Debug\net8.0\worker.config.json" because it was not found.
..\..\..\..\program files\microsoft visual studio\2022\preview\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets (5321, 5): Could not copy the file "D:\NCrunchWorkspace\46204\7\FunctionApp1\obj\Debug\net8.0\extensions.json" because it was not found.


That could be an issue for those of us who cannot easily upgrade their packages.


Good catch. I'll look into this. Thanks for letting me know.

Post a reply

Log in to reply.