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

Notification

Icon
Error

version 1.17.0 of Microsoft.Azure.Functions.Worker.Sdk makes ncrunch look for .net6
Gamefaster
#1 Posted : Sunday, February 25, 2024 2:20:53 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/30/2015(UTC)
Posts: 7
Location: United Kingdom

Thanks: 1 times
When updating the packages in a brand ne function app I notices that going from version 1.16.4 to version 1.17.0 of Microsoft.Azure.Functions.Worker.Sdk produces the following error

..\..\..\..\Program Files\dotnet\sdk\8.0.200\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets (266, 5): Assets file 'C:\Users\user\AppData\Local\NCrunch\21476\1\MyApp\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.

I am on version 4.19.0.14 of nCrunch and version 17.9.1 of Visual Studio
Remco
#2 Posted : Sunday, February 25, 2024 4:20:26 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,981

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Hi, thanks for sharing this issue.

Does this project build without the error in Visual Studio?

Is this something you can reproduce with a sample project you can share with me?
Gamefaster
#3 Posted : Monday, February 26, 2024 3:36:20 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/30/2015(UTC)
Posts: 7
Location: United Kingdom

Thanks: 1 times
Yes it all builds and test run fine in Visual studio and Resharper.

If you
create a new function app with .net8.0 isolated long terms support
  • build the solution

  • enable ncrunch - the project will build

  • open manage packages for solution

  • update all packages apart from Microsoft.Azure.Functions.Worker.Sdk

  • ncrunch will still work and build the function

  • now update Microsoft.Azure.Functions.Worker.Sdk and ncrunch fails to build the project before it even tries to run tests
Remco
#4 Posted : Tuesday, February 27, 2024 1:49:35 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,981

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Gamefaster
#5 Posted : Tuesday, February 27, 2024 10:02:25 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/30/2015(UTC)
Posts: 7
Location: United Kingdom

Thanks: 1 times
Unfortunately that Didn't work and ended up breaking ncrunch across the board so even a new project didn't build.

This is the trace output
System.InvalidOperationException: No process is associated with this object.
at System.Diagnostics.Process.EnsureState(State state)
at System.Diagnostics.Process.EnsureState(State state)
at System.Diagnostics.Process.get_Id()
at nCrunch.Core.ProcessManagement.ExternalProcessManager.(ExternalProcess )
at nCrunch.Core.ProcessManagement.ExternalProcessManager.(EffectiveProcessorArchitecture , ProcessLoadParameters , Boolean )
at nCrunch.Core.ProcessManagement.ExternalProcessManager.(EffectiveProcessorArchitecture , ProcessLoadParameters )
at nCrunch.Core.ProcessManagement.ExternalProcessManager.LoadExternalProcess(ProcessLoadParameters parameters, GridClientId client)
at nCrunch.Core.BuildManagement.BuildProcessLauncher..()
at nCrunch.Core.BuildManagement.BuildProcessLauncher.(Action`1 , EffectiveProcessorArchitecture , GridClientId , BuildSystemParameters , IList`1 , Nullable`1 , GridClientDescription , DotNetCoreSdkVersion  )
at nCrunch.Core.BuildManagement.BuildProcessLauncher.AnalyseComponentBuildInExternalProcess(ComponentLoadParameters parameters, IList`1 customEnvironmentVariables)
at nCrunch.Client.ComponentLoader.SnapshotComponentLoader.(EffectiveProcessorArchitecture , String )
at nCrunch.Client.ComponentLoader.SnapshotComponentLoader.CreateComponentFromXml(FilePath projectFilePath, ParsedBuildXml projectXml, FilePath solutionFilePath, String[] additionalFilesToIncludeAtSolutionLevel, Boolean isLoadedFromFile, IDEVersion ideVersion, BuildEngineId buildEngineId, ComponentUniqueName componentName, TaskSettings componentTaskSettings, Exception parseException, String targetFrameworkForMsbuild, String visibleTargetFramework)

Remco
#6 Posted : Tuesday, February 27, 2024 10:32:38 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,981

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Sorry to hear that. Could you submit an NCrunch bug report after you've had this happen to you? I'm hopeful the log will contain the reason for the process suddenly disappearing. Then windows event viewer may also have some information here. According to this error, the worker process simply disappeared before it was fully tethered.

Edit: Also check the logs from any virus scanner or security software you have installed. If something on your machine took down the process, it can often cause this error.
Gamefaster
#7 Posted : Wednesday, February 28, 2024 10:55:29 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/30/2015(UTC)
Posts: 7
Location: United Kingdom

Thanks: 1 times
Sorry did you want a bug reported with the updated version you gave me or the ga version that is on the site?
Remco
#8 Posted : Wednesday, February 28, 2024 11:18:04 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,981

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Gamefaster;17038 wrote:
Sorry did you want a bug reported with the updated version you gave me or the ga version that is on the site?


The updated version.

The version I've posted above contains a fix for the Azure functions issue you reported. This was essentially being caused by a nested build inside the MS toolkit, which was being affected by a build property we needed to override to set the project.assets.json file when building the functions project. As far as I can tell, the fix resolves the issue. I'm not sure why the task runners are failing to run on your system with this version, but right now it's the problem we need to solve. The Azure functions issue should be gone now.
Gamefaster
#9 Posted : Wednesday, February 28, 2024 11:56:00 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/30/2015(UTC)
Posts: 7
Location: United Kingdom

Thanks: 1 times
Damn it I just posted a bug fix on the GA release... Let me update and do it agqain
Remco
#10 Posted : Wednesday, February 28, 2024 12:19:01 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,981

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Gamefaster;17040 wrote:
Damn it I just posted a bug fix on the GA release... Let me update and do it agqain


If you can, when updating, could you try the removal and reinstallation fix, making sure to reinstall using the MSI above? I think this would be worth trying as there is a high chance that this error is caused by an install state issue.
Gamefaster
#11 Posted : Wednesday, February 28, 2024 12:30:38 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/30/2015(UTC)
Posts: 7
Location: United Kingdom

Thanks: 1 times
Just found that the machine that is managed by my organisation is now blocking that version of ncrunch which caused the "No process is associated with this object" issue

Blocked By: Attack surface reduction
Rule: Block executable files from running unless they meet a prevalence, age, or trusted list criteria
Affected Items: C:\Users\JayFreeman\AppData\Local\NCrunch\BuildSystem\10328\VS2022\nCrunch.BuildHost462.x64.exe

When I tried the new version on my personal machine it works fine again.

I think we can resolve this as fixed and I will try and get the organisation I am at to unblock ncrunch.

Thanks for your help
Remco
#12 Posted : Wednesday, February 28, 2024 12:52:29 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,981

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Gamefaster;17042 wrote:
Just found that the machine that is managed by my organisation is now blocking that version of ncrunch which caused the "No process is associated with this object" issue


Thanks! I was thinking it would be something like that. There isn't much difference between these builds, and the one posted above won't have been downloaded by many users yet .. so many of the more paranoid scanners would likely flag it.

The Azure function fix will be rolled into the V5 release that will be going out next week. I expect V5 will get quite a lot of attention quickly, which will help with the reputation, and should allow you to get past the scanner in short order.
2 users thanked Remco for this useful post.
Gamefaster on 2/28/2024(UTC), GlobalConcepts on 2/28/2024(UTC)
MatthewSteeples
#13 Posted : Tuesday, March 5, 2024 1:37:19 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 10/28/2014(UTC)
Posts: 130
Location: United Kingdom

Thanks: 7 times
Was thanked: 18 time(s) in 16 post(s)
Fails to build here with NCrunch 5.1 and Microsoft.Azure.Functions.Worker.Sdk 1.17.2. It builds fine if I drop the version of the Functions SDK to 1.16.4

Code:
C:\Users\MatthewSteeples\AppData\Local\Temp\tdmo5dii.0kt\WorkerExtensions.csproj: The target framework 'net8.0' must be 'net6.0'. Verify if target framework has been overridden by a global property.


It uses net6 and a temporary project because it has to build a wrapper for the Functions runtime to know what Functions are available in the "Isolated" model. I know one of the big changes between 1.16 and 1.17 was that it has to specifically ignore some ReadyToRun properties that are passed in to the "parent" project, and looking at the error message it could possibly be related to that
Remco
#14 Posted : Tuesday, March 5, 2024 11:48:07 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,981

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
MatthewSteeples;17079 wrote:

It uses net6 and a temporary project because it has to build a wrapper for the Functions runtime to know what Functions are available in the "Isolated" model. I know one of the big changes between 1.16 and 1.17 was that it has to specifically ignore some ReadyToRun properties that are passed in to the "parent" project, and looking at the error message it could possibly be related to that


Thanks for sharing this. Yes, I think we have something bleeding through into nested build for the temporary project. The fix discussed above worked for 1.17, but 1.17.2 seems to have broken it further. I'm able to reproduce this on my side and will let you know as soon as I have a solution available.
Remco
#15 Posted : Wednesday, March 6, 2024 12:09:31 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,981

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
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.094 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download