I'm testing for my company Ncrunch vs R# Continuous Testing before purshasing licence for every developers.
For now, Ncrunch is far better for me but it does not work with Azure Functions :(
It looks like Ncrunch is not looking the good path to find the dll, in my code exemple Ncrunch looks here :
C:\Users\Bigmat\AppData\Local\NCrunch\17028\9\MyFunction\bin\Debug\netcoreapp2.2\MyFunction.dll
but the real path is :
C:\Users\Bigmat\AppData\Local\NCrunch\17028\9\MyFunction\bin\Debug\netcoreapp2.2\bin\MyFunction.dll
Is it possible to force the path where to look ? or Add this path on your side to check on ?
If someone has any work around I'm very interested because Azure Function is used a lot in our company.
Unfortunately, the Azure platform (and its function projects) is not supported by NCrunch. I'm afraid that I can't offer any workaround to this problem.
It's entirely possible that someone in the community knows of a workaround for this problem and is able to provide advice, but from the product side, unfortunately I can't help here.
I was facing to a bigger problem than just copy some moved binaries with the azure functions targets :
Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'Microsoft.Azure.WebJobs.Extensions.Http, Version=3.0.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
I have done a better version in order to skip directly the Microsoft.NET.Sdk.Functions targets; here is the details :
In the obj folder, a file <project>.nuget.g.targets contains the associated imported targets like that :
As you can see, to disable the targets loading, you can set the ExcludeRestorePackageImports property to true in your project referencing the azure function package like this:
Is this still needed in 2023 with NCrunch v4.16 testing Azure Functions v4 with TargetFramework net6.0?
We have older projects that have been migrated from v3 with TargetFramework netcoreapp3.1 to current versions having configured the two blocks from above and we have current projects not having this blocks.
It seems it makes no difference at all and those entries can be removed.
GlobalConcepts wrote:Is this still needed in 2023 with NCrunch v4.16 testing Azure Functions v4 with TargetFramework net6.0?
No. We implemented a slightly more streamlined version of the above workaround into NCrunch itself, so you shouldn't need to have additional engineering in your project files to make this work now.