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

Notification

Icon
Error

NCrunch cannot compile my project whereas VS can
htssoftwares
#1 Posted : Tuesday, December 8, 2020 7:37:23 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/10/2020(UTC)
Posts: 5
Location: France

Thanks: 1 times
NCrunch cannot compile my project whereas VS can.

The project is this one : https://github.com/hybri...FCore.Integration.Tests

Got a huge stacktrace like this one :

Error while discovering test 'CQELight.DAL.EFCore.Integration.Tests.Adapters.EFCoreDataWriterAdapterTests.Physical_Deletion_ById':System.Exception: System.TypeLoadException: Method 'GetAsync' in type 'CQELight.DAL.EFCore.EFRepository`1' from assembly 'CQELight.DAL.EFCore, Version=1.2.2.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.
at nCrunch.TestExecution.Reflection.Clr.ClrAssembly.GetTypes()
at nCrunch.TestExecution.Reflection.ReflectedAssembly.GetFlattenedTypes()
at nCrunch.TestExecution.Reflection.ReflectedAssembly.get_TypesByFullName()
at nCrunch.TestExecution.Reflection.ReflectedAssembly.GetTypeByFullName(String typeFullName)
at nCrunch.Module.XUnit2.Integration.XUnitNCrunchDiscoveredTestContainer.StoreDiscoveredTest(ITestCase testCase, TestName testName)
at nCrunch.Module.XUnit2.Integration.XUnitDiscoveryMessageSink.discoverTest(ITestCase testCase)
Error while discovering test 'CQELight.DAL.EFCore.Integration.Tests.Adapters.EFCoreDataWriterAdapterTests.Logical_Deletion_ById':System.Exception: System.TypeLoadException: Method 'GetAsync' in type 'CQELight.DAL.EFCore.EFRepository`1' from assembly 'CQELight.DAL.EFCore, Version=1.2.2.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.
at nCrunch.TestExecution.Reflection.Clr.ClrAssembly.GetTypes()
at nCrunch.TestExecution.Reflection.ReflectedAssembly.GetFlattenedTypes()
at nCrunch.TestExecution.Reflection.ReflectedAssembly.get_TypesByFullName()
at nCrunch.TestExecution.Reflection.ReflectedAssembly.GetTypeByFullName(String typeFullName)
at nCrunch.Module.XUnit2.Integration.XUnitNCrunchDiscoveredTestContainer.StoreDiscoveredTest(ITestCase testCase, TestName testName)
at nCrunch.Module.XUnit2.Integration.XUnitDiscoveryMessageSink.discoverTest(ITestCase testCase)
Error while discovering test 'CQELight.DAL.EFCore.Integration.Tests.Adapters.EFCoreDataWriterAdapterTests.Physical_Deletion':System.Exception: System.TypeLoadException: Method 'GetAsync' in type 'CQELight.DAL.EFCore.EFRepository`1' from assembly 'CQELight.DAL.EFCore, Version=1.2.2.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.
at nCrunch.TestExecution.Reflection.Clr.ClrAssembly.GetTypes()
at nCrunch.TestExecution.Reflection.ReflectedAssembly.GetFlattenedTypes()
at nCrunch.TestExecution.Reflection.ReflectedAssembly.get_TypesByFullName()
at nCrunch.TestExecution.Reflection.ReflectedAssembly.GetTypeByFullName(String typeFullName)
at nCrunch.Module.XUnit2.Integration.XUnitNCrunchDiscoveredTestContainer.StoreDiscoveredTest(ITestCase testCase, TestName testName)
at nCrunch.Module.XUnit2.Integration.XUnitDiscoveryMessageSink.discoverTest(ITestCase testCase)
Error while discovering test 'CQELight.DAL.EFCore.Integration.Tests.Adapters.EFCoreDataWriterAdapterTests.EFRepository_Logical_Deletion':System.Exception: System.TypeLoadException: Method 'GetAsync' in type 'CQELight.DAL.EFCore.EFRepository`1' from assembly 'CQELight.DAL.EFCore, Version=1.2.2.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.
at nCrunch.TestExecution.Reflection.Clr.ClrAssembly.GetTypes()
at nCrunch.TestExecution.Reflection.ReflectedAssembly.GetFlattenedTypes()
at nCrunch.TestExecution.Reflection.ReflectedAssembly.get_TypesByFullName()
at nCrunch.TestExecution.Reflection.ReflectedAssembly.GetTypeByFullName(String typeFullName)
at nCrunch.Module.XUnit2.Integration.XUnitNCrunchDiscoveredTestContainer.StoreDiscoveredTest(ITestCase testCase, TestName testName)
at nCrunch.Module.XUnit2.Integration.XUnitDiscoveryMessageSink.discoverTest(ITestCase testCase)
at nCrunch.Module.XUnit2.Integration.XUnit2DiscoveryEnvironment.FindFrameworkTestsInAssembly(ReflectedAssembly assembly, FilePath assemblyFilePath, IList`1 referencedAssemblyFilePaths, ComponentUniqueName testComponentUniqueName, PlatformType platformType, DynamicProxy[] dynamicProxies)
at nCrunch.TestExecution.TestFinder.<>c__DisplayClass0_2.<FindTestsForFrameworks>b__1()
at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
at nCrunch.TestExecution.TestFinder.<>c__DisplayClass0_0.<FindTestsForFrameworks>b__0()
at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
at nCrunch.TestExecution.TestFinder.FindTestsForFrameworks(ReflectedAssembly assembly, FilePath assemblyFilePath, IList`1 referencedAssemblyFilePaths, DescribedTestFrameworkDiscoverer[] describedDiscoverers, ComponentUniqueName testComponentUniqueName, PlatformType platformType, DynamicProxy[] dynamicProxies)
at nCrunch.TestExecution.RemoteTaskRunner.AnalyseAssembly(DescribedTestFrameworkDiscoverer[] applicableFrameworks, ComponentUniqueName testComponentUniqueName, PerfTracker perfTracker)
...

Any help would be appreciated !
Remco
#2 Posted : Tuesday, December 8, 2020 11:09:53 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 810 times
Was thanked: 1077 time(s) in 1022 post(s)
Thanks for sharing this issue.

At a glance, this looks like a dependency issue.

We'll take a deeper look and will get back to you soon.
michaelkroes
#3 Posted : Friday, December 11, 2020 5:38:30 PM(UTC)
Rank: NCrunch Developer

Groups: Registered
Joined: 9/22/2017(UTC)
Posts: 228
Location: Netherlands

Thanks: 100 times
Was thanked: 50 time(s) in 48 post(s)
We're still looking into this. In the mean time as a workaround setting Copy referenced assemblies to workspace to True for CQELight.DAL.EFCore.Integration.Tests makes it compile and run tests.
Remco
#4 Posted : Monday, December 28, 2020 12:49:15 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 810 times
Was thanked: 1077 time(s) in 1022 post(s)
We've spent the last couple of weeks looking into this issue in detail. Because of the structure involved and the complexity of the dependency resolution system in general, it's been a frustratingly time consuming task. I appreciate you taking the time to share your code with us, as analysis of the problem would have been impossible without it.

The problem is actually intermittent in nature and isn't caused by NCrunch. Because the dependency structure involves two separate (in this case clashing) versions of netstandard, its surfacing depends entirely on the order in which assemblies are being loaded into the runtime environment. We noticed that in some circumstances (i.e. grid nodes or different machines), the problem simply wouldn't appear at all. Turning on the 'Copy referenced assemblies to workspace' setting changed the assembly load order and suppressed the issue. Turning on the Pre-load assembly references setting does the same, as this tells NCrunch to force the assembly load order to prevent abnormalities from happening.

We can't fix this inside NCrunch, as there's no way to pin down the complex interactions between different versions of netstandard.

There is no guarantee that you won't see this problem outside NCrunch. I recommend aligning the versions of netstandard you are using as much as possible to prevent clashes caused by resolution order. Under NCrunch you can use the 'Copy referenced assemblies to workspace' or 'Pre-load assemby references' settings to suppress the issue.
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.242 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download