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

Notification

Icon
Error

The NCrunch engine process was unexpectedly terminated. Re-enable the engine to continue
luiz4our
#1 Posted : Wednesday, April 10, 2024 3:36:56 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 7/8/2020(UTC)
Posts: 6
Location: Korea, South

Thanks: 2 times
The most recent version is 5.5.
I'm trying to use ncrunch in Unity3D.
In version 4.16, an error log appeared, but from 5.5 onwards, the error log does not appear and it stops like that. Is there a way to check the error log?

The NCrunch engine process was unexpectedly terminated. Re-enable the engine to continue


[img]https://drive.google.com/file/d/1Vds-uStzBrXLkcYgS1VfW2JZlUs86xMS/view?usp=drive_link[/img]
luiz4our
#2 Posted : Wednesday, April 10, 2024 3:48:49 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 7/8/2020(UTC)
Posts: 6
Location: Korea, South

Thanks: 2 times
I don't know why, but errors are starting to appear,
This error appears...


An error occurred while analyzing this project after it was built: System.BadImageFormatException: Unable to load file or assembly 'netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. You can not. Reference assemblies should not be loaded and run. Reference assemblies can only be loaded in a reflection-only loader context. (HRESULT where exception occurred: 0x80131058)
File name: 'netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' ---> System.BadImageFormatException: File or assembly 'file:///C:\Program Files\Unity\Hub\Editor\2022.3 Could not load '.18f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\netstandard.dll' or one of its dependencies. Reference assemblies should not be loaded and run. Reference assemblies can only be loaded in a reflection-only loader context. (HRESULT where exception occurred: 0x80131058)
File name: 'file:///C:\Program Files\Unity\Hub\Editor\2022.3.18f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\netstandard.dll' ---> System.BadImageFormatException : Unable to load reference assembly for execution.
Location: System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
Location: System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
Location: System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
Location: System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
Location: System.Reflection.Assembly.LoadFrom(String assemblyFile)
Location: nCrunch.Common.NCrunchAssembly.LoadFrom(String assemblyFile)
Location: nCrunch.Common.CustomAssemblyResolver.resolveAssemblyFrom(IEnumerable`1 possibleAssemblyPaths, ParsedAssemblyName parsedAssemblyName)
Location: nCrunch.Common.CustomAssemblyResolver.ResolveAssembly(ParsedAssemblyName parsedAssemblyName)
Location: nCrunch.Common.CustomAssemblyResolver.AssemblyResolve(Object sender, ResolveEventArgs args)
Location: System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName)


Location: System.Reflection.CustomAttribute._CreateCaObject(RuntimeModule pModule, IRuntimeMethodInfo pCtor, Byte** ppBlob, Byte* pEndBlob, Int32* pcNamedArgs)
Location: System.Reflection.CustomAttribute.CreateCaObject(RuntimeModule module, IRuntimeMethodInfo ctor, IntPtr& blob, IntPtr blobEnd, Int32& namedArgs)
Location: System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent)
Location: System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly assembly, RuntimeType caType)
Location: System.Reflection.RuntimeAssembly.GetCustomAttributes(Boolean inherit)
Location: nCrunch.Module.NUnit3.Integration.NUnit3FrameworkInteractor..ctor(ReflectedAssembly assembly, IList`1 referencedAssemblyFilePaths, ComponentUniqueName testComponentUniqueName, DynamicProxy[] dynamicProxies)
Location: nCrunch.Module.NUnit3.Integration.NUnit3FrameworkRuntimeEnvironment.FindFrameworkTestsInAssembly(ReflectedAssembly assembly, FilePath assemblyFilePath, IList`1 referencedAssemblyFilePaths, ComponentUniqueName testComponentUniqueName, PlatformType platformType, DynamicProxy[] dynamicProxies)
Location: nCrunch.TestExecution.TestFinder. . ()
Location: nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
Location: nCrunch.TestExecution.TestFinder. . ()
Location: nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
Location: nCrunch.TestExecution.TestFinder.FindTestsForFrameworks(ReflectedAssembly assembly, FilePath assemblyFilePath, IList`1 referencedAssemblyFilePaths, DescribedTestFrameworkDiscoverer[] describedDiscoverers, ComponentUniqueName testComponentUniqueName, PlatformType platformType, DynamicProxy[] dynamicProxies)
Location: nCrunch.TestExecution.RemoteTaskRunner.AnalyseAssembly(DescribedTestFrameworkDiscoverer[] applicableFrameworks, ComponentUniqueName testComponentUniqueName, PerfTracker perfTracker, TaskLogId taskLogId)

(Korean -> English Translated)
Remco
#3 Posted : Thursday, April 11, 2024 12:01:36 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi, thanks for sharing this issue.

Has this project ever worked for you on any version of NCrunch?

It looks like unity is doing something interesting with its handling of framework reference assemblies - it seems to have its own reference assemblies packaged, which is somewhat unconventional. We haven't done any testing of NCrunch over Unity, so I'm not sure how effective our compatibility is in this area.

The exception itself looks to be triggered by an assembly-level attribute declared in your test project. It's possible that removing these attribute declarations while under NCrunch may get you past this problem. I'd suggest placing a compiler conditional around them, like so:
#if NCrunch
.... attribute declarations / Assembly.cs
#endif
1 user thanked Remco for this useful post.
luiz4our on 4/15/2024(UTC)
luiz4our
#4 Posted : Monday, April 15, 2024 9:13:59 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 7/8/2020(UTC)
Posts: 6
Location: Korea, South

Thanks: 2 times
In Unity 2018 version, I used it according to the method in this repository. https://github.com/networm/NCrunchAdapterForUnity
Following this method, ncrunch worked normally with unity.
The ncrunch version at this time was 4.16.

But Unity was upgraded to version 2019 and does not work this way, so we are trying to figure out the cause.
luiz4our
#5 Posted : Monday, April 15, 2024 9:19:18 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 7/8/2020(UTC)
Posts: 6
Location: Korea, South

Thanks: 2 times
Thank you for answer.

However, I am not familiar with C# projects and NCrunch options.
#if NCrunch
.... attribute declarations / Assembly.cs
#endif
▲ I'm not sure where to implement this method. Can you help me?
Remco
#6 Posted : Monday, April 15, 2024 9:23:37 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
I've done some deeper looking into Unity and how it works. It seems that Unity projects don't fit within the same general structure of VS solutions. The build system isn't the same and they use their own libraries as a foundation for the code. As you've identified, they also have their own customised version of NUnit.

To have them work under NCrunch, we would need to take a top-to-bottom approach that would require quite a bit of extensive integration, designing a lot of NCrunch around how they handle things. Probably not impossible, but also not something we would be able to handle in the pursuit of resolving a support issue. Basically, it's a whole different platform, and we don't support it right now.

There may be ways to make your tests run under NCrunch by setting up shared code between a normal NUnit test project and a unity test project, perhaps with cross compiling, shared projects, or a lot of MSBuild and compiler conditionals. Unfortunately, I can't be of more help here. If you'd like to see support extended to this platform, I recommend submitting a feature request with uservoice. If enough people are looking to use NCrunch on this platform we may be able to justify introducing support for it in future.
1 user thanked Remco for this useful post.
luiz4our on 4/23/2024(UTC)
luiz4our
#7 Posted : Tuesday, April 23, 2024 3:17:06 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 7/8/2020(UTC)
Posts: 6
Location: Korea, South

Thanks: 2 times
Thank you for your reply.
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.072 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download