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

Notification

Icon
Error

2 Pages<12
.NET Core support for NCrunch (first public build)
GreenMoose
#19 Posted : Wednesday, March 8, 2017 10:45:29 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 6/17/2012(UTC)
Posts: 503

Thanks: 142 times
Was thanked: 66 time(s) in 64 post(s)
Remco;9887 wrote:
Before I put v3.5 up, I'd like to learn a bit more about the other bug report you just submitted.

The project you have that NCrunch is failing to analyse is falling over because of a missing dependency, System.Diagnostics.TraceSource v4.0.0.0.

Are you able to identify how this package is being referenced from your project? Is it being referenced directly? If the project is built, does the reference show in the generated .deps.json file in the build output directory?

Also, is the package installed on your machine?

NCrunch should usually identify all these references and flag them up so they can be found in the runtime environment. It's expected that VS would have automatically restored them if they are being used.


Regarding System.Diagnostics.TraceSource
Remco;9887 wrote:
Is it being referenced directly?

No
(PM> get-package System.Diagnostics.TraceSource => "No packages installed.")

Remco;9887 wrote:
If the project is built, does the reference show in the generated .deps.json file in the build output directory?

Yes, it seems to be related to NLog:
Quote:

"nlog/5.0.0-beta03": {
"dependencies": {
"Microsoft.Extensions.PlatformAbstractions": "1.0.0",
"NETStandard.Library": "1.6.0",
"System.Collections.NonGeneric": "4.0.1",
"System.ComponentModel.TypeConverter": "4.1.0",
"System.Data.Common": "4.1.0",
"System.Diagnostics.Contracts": "4.0.1",
"System.Diagnostics.StackTrace": "4.0.1",
"System.Diagnostics.TraceSource": "4.0.0",
"System.IO.FileSystem.Watcher": "4.0.0",
"System.Net.NameResolution": "4.0.0",
"System.Net.Requests": "4.0.11",
"System.Reflection.TypeExtensions": "4.1.0",
"System.Runtime.Serialization.Primitives": "4.1.1",
"System.Security.AccessControl": "4.0.0",
"System.Security.Principal": "4.0.1",
"System.Threading": "4.0.11",
"System.Threading.AccessControl": "4.0.0",
"System.Threading.Thread": "4.0.0",
"System.Threading.ThreadPool": "4.0.10",
"System.Xml.XmlDocument": "4.0.1"
},
"runtime": {
"lib/netstandard1.5/NLog.dll": {}
}
},


Remco;9887 wrote:
Also, is the package installed on your machine?

It exists at C:\Users\<user>\.nuget\packages\system.diagnostics.tracesource (both 4.0.0 and 4.3.0).
GreenMoose
#22 Posted : Wednesday, March 8, 2017 10:55:21 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 6/17/2012(UTC)
Posts: 503

Thanks: 142 times
Was thanked: 66 time(s) in 64 post(s)
FWIW, if I create a new project in vs2017, copy the same source files, and then add the NLog dependency via nuget it builds fine. I plan to do this for all projects since I get a lot of miscellaneous warnings in vstudio regarding versions I don't want to spend time on :).
Remco
#23 Posted : Wednesday, March 8, 2017 11:01:55 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 930 times
Was thanked: 1257 time(s) in 1170 post(s)
GreenMoose;9891 wrote:
FWIW, if I create a new project in vs2017, copy the same source files, and then add the NLog dependency via nuget it builds fine. I plan to do this for all projects since I get a lot of miscellaneous warnings in vstudio regarding versions I don't want to spend time on :).


I was about to say ... I can't seem to reproduce this. When I try to set up project using NUnit/NLog, all the resolutions seem to work out correctly and it references v4.0.0.0 of System.Diagnostics.TraceSource.

I doubt we've seen the last of this issue. What I'm not sure about is whether it's a downstream issue caused by a tooling problem (i.e. out of date/sync project.assets.json file), or whether there is a use case here that NCrunch isn't handling right.

Please do let me know if you find a way to reproduce it consistently. If you can get it to happen again, I'm very interested in the nCrunch.TaskRunner.DotNetCore.x64.deps.json file that NCrunch generates in the build output directory for the project. This deps file basically tells the .NET Core CLR which packages are required in the test environment and acts as a mapping between the environment and its dependencies. In theory, System.Diagnostics.TraceSource v4.0.0.0 should be listed in this file for the environment to find this package. If it isn't listed, there might be something that can be fixed.
Remco
#26 Posted : Wednesday, March 8, 2017 11:11:56 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 930 times
Was thanked: 1257 time(s) in 1170 post(s)
v3.5 is now available with a fix for nunit.framework assembly resolution - https://www.ncrunch.net/download
1 user thanked Remco for this useful post.
GreenMoose on 3/8/2017(UTC)
GreenMoose
#24 Posted : Wednesday, March 8, 2017 11:50:45 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 6/17/2012(UTC)
Posts: 503

Thanks: 142 times
Was thanked: 66 time(s) in 64 post(s)
Remco;9892 wrote:
GreenMoose;9891 wrote:
FWIW, if I create a new project in vs2017, copy the same source files, and then add the NLog dependency via nuget it builds fine. I plan to do this for all projects since I get a lot of miscellaneous warnings in vstudio regarding versions I don't want to spend time on :).


I was about to say ... I can't seem to reproduce this.

I've sent you the repro solution via email if you want to look into it in more detail.
Remco
#25 Posted : Wednesday, March 8, 2017 11:53:14 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 930 times
Was thanked: 1257 time(s) in 1170 post(s)
GreenMoose;9894 wrote:

I've sent you the repro solution via email if you want to look into it in more detail.


Perfect, thanks! I'll get back to you on this soon.
GreenMoose
#27 Posted : Wednesday, March 8, 2017 10:18:13 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 6/17/2012(UTC)
Posts: 503

Thanks: 142 times
Was thanked: 66 time(s) in 64 post(s)
Another issue I just bumped into, trying to reference NCrunch.Framework:
Quote:
install-package : Package NCrunch.Framework 3.3.0.6 is not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1)
Remco
#28 Posted : Wednesday, March 8, 2017 11:06:31 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 930 times
Was thanked: 1257 time(s) in 1170 post(s)
For NCrunch.Framework, you'll need to use the NCrunch.Framework.DotNetCore.dll that's sitting in the NCrunch installation directory (under VS extensions/RemcoSoftware). This will be published through the NCrunch NuGet package when I find a clean way to do this :)
Remco
#29 Posted : Thursday, March 9, 2017 12:45:03 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 930 times
Was thanked: 1257 time(s) in 1170 post(s)
Ok, I've figured out the System.Diagnostics.TraceSource resolution issue.

This is happening because the unit test project is set to target netstandard, rather than netcoreapp.

When projects are built for netstandard, they are platform-independent and do not have the .deps bindings for platform-specific DLLs (like System.Diagnostics.TraceSource). This prevents the CLR from finding the references at run time.

Typically, these projects are only executed via references from other platform-specific projects (like netcoreapp). Having tests sitting in a netstandard project doesn't really make sense when you think about it, as the tests need to run under a specific platform and netstandard is completely agnostic.

I'll introduce a fix in the next version of NCrunch to give a better error message in case anyone else has a similar setup.
1 user thanked Remco for this useful post.
GreenMoose on 3/9/2017(UTC)
eric_r
#30 Posted : Saturday, April 14, 2018 6:35:47 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/14/2018(UTC)
Posts: 1
Location: United States of America

Has this been resolved yet?

VS 2017 15.3.5
I am running .net core 2.0
I am running nCrunch version: 3.8.0.3
I am getting the same message.
I have one .net core project and one .net core mstest project. both target core 2.0 (2.0.6)

The error is this:

NCrunch encountered an error while trying to construct an environment to execute this test: 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.(Nullable`1 , FilePath , GridClientId , CustomEnvironmentVariable[] )
at nCrunch.Core.TestManagement.TestRunnerProcess..()
at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
at nCrunch.Core.Processing.TestExecutionTaskLogic.DoProcessTaskAndReturnSuccessFlag()

If I just create a .net core ms project 2.0, nCrunch works as expected. If I add a reference to a .net core webapi project then I get the message above. Is there a set up steps to resolve this?

Appreciate any direction/help. Thank you.
Remco
#31 Posted : Saturday, April 14, 2018 11:26:26 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 930 times
Was thanked: 1257 time(s) in 1170 post(s)
Hi,

This issue has been resolved a long time ago. It's been nearly a year since NCrunch v3.8, and .NET Core has moved considerably since this release. At the time of NCrunch v3.8, .NET Core 2.0 didn't exist yet. I strongly recommend upgrading your NCrunch.
Users browsing this topic
Guest
2 Pages<12
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.077 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download