Error

 3 Pages123>
 Unable to run tests with .NET Core 2.0 referencing .NET Standard 2.0 Previous Topic Next Topic
 bartj #1 Posted : Monday, August 14, 2017 8:59:55 PM(UTC) Rank: MemberGroups: Registered Joined: 12/4/2013(UTC)Posts: 14Location: New ZealandThanks: 2 timesWas thanked: 1 time(s) in 1 post(s) I have a simple solution with a .NET Standard 2.0 (RTM) project and a .NET Core 2.0 (RTM) project that depends on the .NET Standard project. The solution builds fine in Visual Studio, but NCrunch simply shows a blue question-mark next to the test project. It also fails to build the .NET Standard 2.0 project, but that isn't a problem for me because it doesn't contain tests.When I remove the dependency from the test project to the .NET Standard project and comment out the test body, the project builds in NCrunch and the tests run.Is .NET Standard 2.0 / .NET Core 2.0 compatibility coming soon?UPDATE: this problem also occurs when referencing a .NET Standard 2.0 project from a .NET Framework 4.7 project. I'm running NCrunch 3.10.0.20. Back to top
 Remco #2 Posted : Monday, August 14, 2017 11:27:22 PM(UTC) Rank: NCrunch DeveloperGroups: Administrators Joined: 4/16/2011(UTC)Posts: 5,238Thanks: 691 timesWas thanked: 843 time(s) in 803 post(s) Hi, thanks for sharing this problem.Handling of .NET Core/Standard 2.0 is hit and miss at the moment. The reason for this is because every time NCrunch gets updated to handle this framework, MS push out a new release and it all gets broken again. Although .NET Core 2.0 is now announced as 'RTM' by Microsoft, NCrunch is still totally reliant on the MS tool stack that supports it, and this tool stack isn't expected to be released until mid September.I appreciate you reporting a use case here that doesn't work correctly, I'll make sure I have a chance to review it before the next NCrunch update. Back to top
 DavidArnoDandG #3 Posted : Tuesday, August 15, 2017 3:38:12 PM(UTC) Rank: NewbieGroups: Registered Joined: 3/16/2017(UTC)Posts: 6Location: United KingdomThanks: 1 timesWas thanked: 4 time(s) in 2 post(s) If it helps, I have a solution at https://github.com/David...o/Standard.Abstractions that has such problems (though may not be directly related to the OP's issue).Using VS2017 Update 3, netstandard 2.0 and .NET Core 2.0 RTW's (all updated today), with NCrunch v3.10, NCrunch gives the following error when it attempts to build:Quote:System.ArgumentNullException: Value cannot be null.Parameter name: type at _Mono.Cecil.ModuleDefinition.Import(TypeReference type) at nCrunch.Compiler.StaticManipulation.StaticInstrumentationImportMethodSet..ctor(CustomCecilAssemblyResolver resolver, ModuleDefinition module) at nCrunch.Core.PlatformTypes.DotNetCorePlatformType.GetInstrumentationMethodsForFramework(CustomCecilAssemblyResolver resolver, AssemblyDefinition assembly) at nCrunch.Compiler.StaticManipulation.BuiltAssembly.Instrument(ComponentSourceLineMap sourceLineMap, IDictionary2 instrumentationDirectivesByCodeFileId, IDictionary2 codeFileIDsByFilePath, Boolean proxyProcessIsActive, Int32 componentId, IInstrumentationFilter[] instrumentationFilters, IBuildPlatformType platformType, PerfTracker perfTracker) at nCrunch.Compiler.RemoteBuildRunner.(ComponentBuildParameters , FilePath , BuildOutput , DirectoryPath[] , FilePath[] ) at nCrunch.Compiler.RemoteBuildRunner..() at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity) at nCrunch.Compiler.RemoteBuildRunner.(ComponentBuildParameters )Apologies though if this is an unrelated issue. Back to top 3 users thanked DavidArnoDandG for this useful post. Remco on 8/15/2017(UTC), osoykan on 8/15/2017(UTC), sextondjc on 8/15/2017(UTC)
 osoykan #4 Posted : Tuesday, August 15, 2017 8:53:24 PM(UTC) Rank: NewbieGroups: Registered Joined: 3/15/2017(UTC)Posts: 4Location: TurkeyThanks: 2 times Yes, I have the same error, too.DavidArnoDandG;10986 wrote:If it helps, I have a solution at https://github.com/David...o/Standard.Abstractions that has such problems (though may not be directly related to the OP's issue).Using VS2017 Update 3, netstandard 2.0 and .NET Core 2.0 RTW's (all updated today), with NCrunch v3.10, NCrunch gives the following error when it attempts to build:Quote:System.ArgumentNullException: Value cannot be null.Parameter name: type at _Mono.Cecil.ModuleDefinition.Import(TypeReference type) at nCrunch.Compiler.StaticManipulation.StaticInstrumentationImportMethodSet..ctor(CustomCecilAssemblyResolver resolver, ModuleDefinition module) at nCrunch.Core.PlatformTypes.DotNetCorePlatformType.GetInstrumentationMethodsForFramework(CustomCecilAssemblyResolver resolver, AssemblyDefinition assembly) at nCrunch.Compiler.StaticManipulation.BuiltAssembly.Instrument(ComponentSourceLineMap sourceLineMap, IDictionary2 instrumentationDirectivesByCodeFileId, IDictionary2 codeFileIDsByFilePath, Boolean proxyProcessIsActive, Int32 componentId, IInstrumentationFilter[] instrumentationFilters, IBuildPlatformType platformType, PerfTracker perfTracker) at nCrunch.Compiler.RemoteBuildRunner.(ComponentBuildParameters , FilePath , BuildOutput , DirectoryPath[] , FilePath[] ) at nCrunch.Compiler.RemoteBuildRunner..() at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity) at nCrunch.Compiler.RemoteBuildRunner.(ComponentBuildParameters )Apologies though if this is an unrelated issue. Back to top
 sextondjc #5 Posted : Tuesday, August 15, 2017 9:44:01 PM(UTC) Rank: MemberGroups: Registered Joined: 6/7/2017(UTC)Posts: 10Location: IrelandThanks: 3 timesWas thanked: 3 time(s) in 3 post(s) Same here. Back to top
 Remco #6 Posted : Wednesday, August 16, 2017 6:37:08 AM(UTC) Rank: NCrunch DeveloperGroups: Administrators Joined: 4/16/2011(UTC)Posts: 5,238Thanks: 691 timesWas thanked: 843 time(s) in 803 post(s) Back to top 2 users thanked Remco for this useful post. yanglee on 8/16/2017(UTC), EsbjornRedmo on 8/17/2017(UTC)
 Remco #8 Posted : Wednesday, August 16, 2017 12:32:28 PM(UTC) Rank: NCrunch DeveloperGroups: Administrators Joined: 4/16/2011(UTC)Posts: 5,238Thanks: 691 timesWas thanked: 843 time(s) in 803 post(s) Hi David,If I were to guess, this looks to be the result of confusion in the test environment between the netstandard compile-time assembly and run-time assembly. Probably this is the result of another late-game change to the .NET Core toolset.Unfortunately I'm not sure how to produce this. It doesn't look to be specific to a default netstandard project, so I guess there must be another variable here. Is there any chance you could share with me a self-contained code sample that I can use to reproduce the problem? You're welcome to submit any code through the contact form. Back to top
 DavidArnoDandG #9 Posted : Wednesday, August 16, 2017 2:50:52 PM(UTC) Rank: NewbieGroups: Registered Joined: 3/16/2017(UTC)Posts: 6Location: United KingdomThanks: 1 timesWas thanked: 4 time(s) in 2 post(s) Hi Remco,The code that exhibits this behaviour can be git pulled from https://github.com/David.../Standard.Abstractions. But if it's easier for you if I send it directly, please let me know.David. Back to top 1 user thanked DavidArnoDandG for this useful post. Remco on 8/18/2017(UTC)
 EsbjornRedmo #10 Posted : Thursday, August 17, 2017 7:05:21 AM(UTC) Rank: NewbieGroups: Registered Joined: 8/17/2017(UTC)Posts: 1Location: United KingdomThanks: 2 times Found a partial workaround: as long as the assembly with the actual tests target .net framework (net461 in my case), and the csproj file contains a true tag, I could get it to run code from a NetStardard2.0 project. Back to top
 DavidArnoDandG #11 Posted : Thursday, August 17, 2017 7:42:17 AM(UTC) Rank: NewbieGroups: Registered Joined: 3/16/2017(UTC)Posts: 6Location: United KingdomThanks: 1 timesWas thanked: 4 time(s) in 2 post(s) Thanks EsbjornRedmo, that fixes the issue for me. Back to top
 Remco #12 Posted : Friday, August 18, 2017 7:07:33 AM(UTC) Rank: NCrunch DeveloperGroups: Administrators Joined: 4/16/2011(UTC)Posts: 5,238Thanks: 691 timesWas thanked: 843 time(s) in 803 post(s) Back to top 3 users thanked Remco for this useful post. yanglee on 8/18/2017(UTC), EsbjornRedmo on 8/18/2017(UTC), sextondjc on 8/20/2017(UTC)
 sextondjc #13 Posted : Sunday, August 20, 2017 12:34:45 AM(UTC) Rank: MemberGroups: Registered Joined: 6/7/2017(UTC)Posts: 10Location: IrelandThanks: 3 timesWas thanked: 3 time(s) in 3 post(s) Still seem to be having a problem, unfortunately. Tried setting logging level to verbose but still only get the message below. This comes from Visual Studio 2017 Community version 15.3.1 using NCrunch 3.11.0.5 linked to above. An error occurred while analysing this project after it was built: NCrunch encountered an unexpected error occurred while building an environment to analyse an assembly: nCrunch.TaskRunner.Ipc.IpcConnectionClosedException: The connection has been closed at nCrunch.Core.ProcessManagement.ExternalProcessManager.(ProcessorArchitecture , ProcessLoadParameters ) at nCrunch.Core.ProcessManagement.ExternalProcessManager.LoadExternalProcess(ProcessLoadParameters parameters, GridClientId client) at nCrunch.Core.TestManagement.TestRunnerProcess..() at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity) at nCrunch.Core.TestManagement.TestRunnerProcess.(Nullable1 , FilePath , GridClientId , CustomEnvironmentVariable[] ) at nCrunch.Core.TestManagement.TestRunnerProcess..() at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity) at nCrunch.Core.Processing.AnalysisTaskLogic.DoProcessTaskAndReturnSuccessFlag()Not sure if this helps but I'm also using Resharper Ultimate as well as OzCode. Back to top
 sextondjc #15 Posted : Sunday, August 20, 2017 4:36:08 PM(UTC) Rank: MemberGroups: Registered Joined: 6/7/2017(UTC)Posts: 10Location: IrelandThanks: 3 timesWas thanked: 3 time(s) in 3 post(s) Remco;11011 wrote: This looks to be a different problem. This exception is thrown when the .NET Core test process can't initialise and automatically terminates.Where I've seen this in the past, it's been because of missing dependencies. It's possible there's something in your environment that NCrunch isn't accounting for.Could you submit a bug report after you've seen this? The log file may yield something useful.Done. Can't see any missing dependencies but seems plausible as R# is also complaining about an unresolved reference (which it shouldn't). I may well be doing something stupid, but can't see what that might be. Back to top
 sextondjc #17 Posted : Wednesday, August 23, 2017 8:05:52 PM(UTC) Rank: MemberGroups: Registered Joined: 6/7/2017(UTC)Posts: 10Location: IrelandThanks: 3 timesWas thanked: 3 time(s) in 3 post(s) Remco;11017 wrote:NCrunch should normally be trying to restore its dependencies earlier in the session. Has it given you any other warnings or errors worthy of note?Simply creating a new project and adding the System.Threading.Thread v4.1 Nuget package should make VS restore this and place it in your Nuget local storage directory. NCrunch should then work for you, though it is still a mystery to me why NCrunch couldn't handle this earlier in the process.No joy. Tried that, same result. I think that exception was actually from ReSharper (2017.1.3, have since moved to EAP version as recommended here). Does appear to be an NCrunch problem. I created a small test solution to try out against a couple of different test frameworks and runners. Observations below. xUnit (fails)• Build fails immediately as soon as the xUnit nuget package is reference.• NCrunch reports the build as failed with the IpcConnectionClosedException pasted above. This is before writing a single line of code. • I've tried this both with using the xUnitProject template as well as with a blank Core assembly and then adding xUnit via nuget. • The test assembly is actually built and available in the test folder (AppData\Local\NCrunch\....). • Needs Microsoft.NET.Test.Sdk to show up in Visual Studio Test Explorer. • Test runs successfully with Visual Studio Test Explorer. • Test runs successfully with ReSharper Dot Cover. MsTest (fails)• Builds successfully but fails the test with same IpcConnectionClosedException before actually executing the test. • Needs Microsoft.NET.Test.Sdk to show up in Visual Studio Test Explorer. • Test runs successfully with Visual Studio Test Explorer. • Test runs successfully with ReSharper Dot Cover. NUnit (succeeds)• Seems to be unaffected, provided the NUnit3TestAdapter v3.8.0 package is installed. • Needs Microsoft.NET.Test.Sdk to show up in Visual Studio Test Explorer. • Test runs successfully with Visual Studio Test Explorer. • Test runs successfully with ReSharper Dot Cover. I've copied the test solution along with verbose NCrunch Diagnostic Output to here. Hope that helps. Back to top
 Remco #18 Posted : Wednesday, August 23, 2017 11:46:38 PM(UTC) Rank: NCrunch DeveloperGroups: Administrators Joined: 4/16/2011(UTC)Posts: 5,238Thanks: 691 timesWas thanked: 843 time(s) in 803 post(s) I don't seem to be seeing the same thing as you are for these scenarios, so probably this problem is related to your system installstate or environment. Could you check which versions of the System.Threading.Thread library you have installed in your user's Nuget package storage directory? (i.e. C:\Users\[USER]\.nuget\packages\System.Threading.Thread). I think this is being caused by changes to .NET Core's assembly resolution system. Back to top
 sextondjc #19 Posted : Thursday, August 24, 2017 5:23:10 PM(UTC) Rank: MemberGroups: Registered Joined: 6/7/2017(UTC)Posts: 10Location: IrelandThanks: 3 timesWas thanked: 3 time(s) in 3 post(s) Remco;11045 wrote:I don't seem to be seeing the same thing as you are for these scenarios, so probably this problem is related to your system installstate or environment. Could you check which versions of the System.Threading.Thread library you have installed in your user's Nuget package storage directory? (i.e. C:\Users\[USER]\.nuget\packages\System.Threading.Thread). I think this is being caused by changes to .NET Core's assembly resolution system.I have 4.0.0 and 4.3.0. Same ones as on nuget.Have reinstalled core SDK. Issue remains. Reckon I'll just re-image my machine and try again. Maybe an unrelated dodgy install broke something somewhere. Will start from scratch and try again. Back to top
 Remco #20 Posted : Thursday, August 24, 2017 11:56:16 PM(UTC) Rank: NCrunch DeveloperGroups: Administrators Joined: 4/16/2011(UTC)Posts: 5,238Thanks: 691 timesWas thanked: 843 time(s) in 803 post(s) sextondjc;11060 wrote:I have 4.0.0 and 4.3.0. Same ones as on nuget.Have reinstalled core SDK. Issue remains. Reckon I'll just re-image my machine and try again. Maybe an unrelated dodgy install broke something somewhere. Will start from scratch and try again. I'm getting reports of a whole range of assembly resolution issues related to changes in the latest version of .NET Core that was released a week or so ago. I'm going to have a dig around to see if I can reproduce any of these to provide closer alignment. I'll update you as soon as I have a build available. Back to top 1 user thanked Remco for this useful post. sextondjc on 8/25/2017(UTC)
 Users browsing this topic Guest
 3 Pages123>
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