Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Cannot build Azure Function having reference to Microsoft.Azure.Functions.Worker.Sdk 1.17.3
arkiaconsulting
#1 Posted : Wednesday, July 24, 2024 12:25:36 PM(UTC)
Rank: Member

Groups: Registered
Joined: 11/30/2019(UTC)
Posts: 10
Location: France

Thanks: 4 times
Was thanked: 12 time(s) in 6 post(s)
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:
Quote:

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
Remco
#2 Posted : Wednesday, July 24, 2024 11:16:16 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,100

Thanks: 952 times
Was thanked: 1280 time(s) in 1187 post(s)
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.
arkiaconsulting
#3 Posted : Thursday, July 25, 2024 6:38:48 AM(UTC)
Rank: Member

Groups: Registered
Joined: 11/30/2019(UTC)
Posts: 10
Location: France

Thanks: 4 times
Was thanked: 12 time(s) in 6 post(s)
@Remco. Thanks ! done
1 user thanked arkiaconsulting for this useful post.
Remco on 7/25/2024(UTC)
Remco
#4 Posted : Friday, July 26, 2024 9:18:52 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,100

Thanks: 952 times
Was thanked: 1280 time(s) in 1187 post(s)
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.
1 user thanked Remco for this useful post.
arkiaconsulting on 7/26/2024(UTC)
Remco
#5 Posted : Saturday, July 27, 2024 2:36:01 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,100

Thanks: 952 times
Was thanked: 1280 time(s) in 1187 post(s)
4 users thanked Remco for this useful post.
arkiaconsulting on 7/27/2024(UTC), mattyboy on 8/1/2024(UTC), jonasby_rhe on 8/29/2024(UTC), rhamzatov on 8/30/2024(UTC)
arkiaconsulting
#6 Posted : Saturday, July 27, 2024 5:09:49 PM(UTC)
Rank: Member

Groups: Registered
Joined: 11/30/2019(UTC)
Posts: 10
Location: France

Thanks: 4 times
Was thanked: 12 time(s) in 6 post(s)
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:

Quote:

..\..\..\..\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.
Remco
#7 Posted : Sunday, July 28, 2024 12:17:03 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,100

Thanks: 952 times
Was thanked: 1280 time(s) in 1187 post(s)
arkiaconsulting;17511 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:

Quote:

..\..\..\..\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.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.066 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download