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

Notification

Icon
Error

3 Pages<123
Unable to run tests with .NET Core 2.0 referencing .NET Standard 2.0
sextondjc
#27 Posted : Sunday, September 03, 2017 8:02:03 PM(UTC)
Rank: Member

Groups: Registered
Joined: 6/7/2017(UTC)
Posts: 10
Location: Ireland

Thanks: 3 times
Was thanked: 3 time(s) in 3 post(s)
Remco;11111 wrote:

I've had another stab at this problem.



I can confirm that 3.11.0.8 works for me as well. Both with and without a reference to the System.Threading.Thread nuget package.

Thanks Remco!
1 user thanked sextondjc for this useful post.
Remco on 9/3/2017(UTC)
Remco
#42 Posted : Monday, September 04, 2017 7:14:34 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 664 times
Was thanked: 782 time(s) in 744 post(s)
The multiple fixes introduced here have now been released with v3.11.
DavidArnoDandG
#43 Posted : Monday, September 04, 2017 10:27:51 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/16/2017(UTC)
Posts: 6
Location: United Kingdom

Thanks: 1 times
Was thanked: 4 time(s) in 2 post(s)
In case you haven't seen it Remco, this announcement regarding .NET Standard may offer some clues to some of the problems we are facing here.
Remco
#44 Posted : Monday, September 04, 2017 10:37:37 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 664 times
Was thanked: 782 time(s) in 744 post(s)
DavidArnoDandG;11139 wrote:
In case you haven't seen it Remco, this announcement regarding .NET Standard may offer some clues to some of the problems we are facing here.


I hadn't seen this. This is very useful for me. Thanks for sharing it.
mdymel
#45 Posted : Monday, September 04, 2017 1:57:01 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 9/4/2017(UTC)
Posts: 1
Location: Poland

Hi,
I have found a new issue with testing ASP.NET Core project (2.0.0 as well as 1.1.2). I prepared a project where it is reproduced:
https://github.com/mdymel/NCrunchFalseNegative
Basically the integration tests fail when the startup class used for tests extends 'normal' Startup class.

Best regards,
Michal
damianh
#46 Posted : Monday, September 04, 2017 9:49:23 PM(UTC)
Rank: Member

Groups: Registered
Joined: 5/5/2014(UTC)
Posts: 14
Location: Netherlands

Was thanked: 2 time(s) in 2 post(s)
Hi,

Been watching this thread, but problems not resolved. No test are being discovered and there is a blue question mark beside all the projects (they are not being built).

VS15.3.3 and NCrunch 3.11.0.8

Repro here https://github.com/damia...Store/tree/netstandard2

If any additional information needed, please let me know.
damianh
#47 Posted : Monday, September 04, 2017 10:03:30 PM(UTC)
Rank: Member

Groups: Registered
Joined: 5/5/2014(UTC)
Posts: 14
Location: Netherlands

Was thanked: 2 time(s) in 2 post(s)
I see an error in the output when "Reload and rebuild selected compontent." . I don't know if related:

ENGINE - [23:59:27.5507-Core-28] Event [ComponentDataUpdatedEvent] is being processed on Core thread with subscriber: ImpactDetector.
[23:59:27.5697-EventReader-180] Event [ErrorEvent:[Error:
Context: (global)
Category: Internal
Message: NCrunch does not support recursive project references
Details: System.Exception: NCrunch does not support recursive project references
at nCrunch.Core.ComponentSorter.SortComponentsInBuildDependencyOrder(IList`1 components)
at nCrunch.Client.Model.EngineWorkflow.(CombinableComponentUpdateData )
at nCrunch.Client.Model.EngineWorkflow.ProcessComponentUpdate(IList`1 components, Boolean alwaysQueueDependencies, Boolean allowSlidingDelay)
at nCrunch.Client.Model.EngineWorkflow.(ComponentsAddedEvent )
]] is being published on thread CoreThread to subscriber: ErrorHandler.
ENGINE - [23:59:27.5507-Core-28] Event [ComponentDataUpdatedEvent] is being processed on Core thread with subscriber: TestTreeSynchroniser.


I've removed all projects except one and it has not project references so I am unable to figure out what this might mean.

Cheers
Remco
#48 Posted : Tuesday, September 05, 2017 12:34:55 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 664 times
Was thanked: 782 time(s) in 744 post(s)
Hi Damian,

Thanks for sharing the source code demonstrating the problem, this always makes things easier. This problem looks to be caused by a referencing issue in your solution. The solution has a Directory.Build.props file at its base, which by MSBuild convention is automatically included in the build system for each project in the solution. This file declares a reference to the primary project in the solution, as such:

<ProjectReference Include="../SqlStreamStore/SqlStreamStore.csproj" />

Because the file is implicitly included in SqlStreamStore.csproj itself, this creates a self reference inside the build system, creating a recursive structure that NCrunch can't handle. The reference also duplicates other references in the solution, creating some interesting warnings in the VS UI.

I am actually quite surprised that VS is able to build this solution. It must have some filter to remove these sorts of things.

When I removed the project reference from the .props file, everything seemed to work OK.
Remco
#49 Posted : Tuesday, September 05, 2017 12:35:51 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 664 times
Was thanked: 782 time(s) in 744 post(s)
Hi Michal,

Thanks for sharing this problem. This is being caused by a .deps file generation issue in NCrunch related to the AspNet.TestHost library. A code fix will be required to resolve this problem. I'll let you know as soon as I have a fixed build available.
Remco
#50 Posted : Wednesday, September 06, 2017 4:45:19 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 664 times
Was thanked: 782 time(s) in 744 post(s)
damianh
#51 Posted : Wednesday, September 06, 2017 8:37:12 AM(UTC)
Rank: Member

Groups: Registered
Joined: 5/5/2014(UTC)
Posts: 14
Location: Netherlands

Was thanked: 2 time(s) in 2 post(s)
> Because the file is implicitly included in SqlStreamStore.csproj itself, this creates a self reference inside the build system, creating a recursive structure that NCrunch can't handle.

Bah!

Sorry I wasted your time.

> I am actually quite surprised that VS is able to build this solution. It must have some filter to remove these sorts of things.

Yeah VS, VS Test Runner, Resharper Test runner, Rider and CLI all worked :/

Edit: perhaps NCrunch should be less strict here, if the others handle it gracefully? Just a thought. Low priority.
Remco
#52 Posted : Wednesday, September 06, 2017 8:58:55 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 664 times
Was thanked: 782 time(s) in 744 post(s)
damianh;11152 wrote:

Yeah VS, VS Test Runner, Resharper Test runner, Rider and CLI all worked :/

Edit: perhaps NCrunch should be less strict here, if the others handle it gracefully? Just a thought. Low priority.


When this area of NCrunch was built, such a recursive structure was impossible to build using any of the UI tools in VS, and coding it in manually would prevent VS from even opening the solution.

Times are changing indeed. I've made a note to make the error a bit less internal, so it can be easily seen and corrected.
Der-Albert.com
#53 Posted : Friday, September 08, 2017 6:59:05 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 5/17/2011(UTC)
Posts: 102

Was thanked: 16 time(s) in 14 post(s)
.NET Core/Standard 2.0 Grid Node Build is totally broken. With 3.11.9/5 it worked before.

The NuGet Package Resolution seems broken. I'm getting weird of missing NuGet Packages in my UserProfile, and from the Visual Studio Installation Path.

Yes, the errors are technically correct (it is an other Version of VS2017 installed on the Grid Node System, in this case the preview) and the nuget packages (.NET Standard 2.0 and others) are not in the
User Profile (for whatever reason - i don't know - there are in different folders, the Grid Node Server than on my local machine). But the normal dotnet build is running, so the the must be available on the system ;)

I installed the same Version of VS 2017 with the same toolset on the Grid Node, and i copied my complete user profile nuget package folder to the Grid Node User Profile Nuget Package Folder (the Grid node runs under then same Account as the VS and the local user).
So the missing packages are now gone. but it still builds not.

Quote:

NCrunch: This project was built on server 'DELL-E-6420'
WithFakes.cs (9, 55): The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
WithFakes.cs (9, 55): The type 'IList<>' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
WithFakes.cs (9, 55): The type 'ICollection<>' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
WithFakes.cs (9, 55): The type 'IEnumerable<>' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
WithFakes.cs (9, 55): The type 'IEnumerable' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
FakeFactory.cs (20, 68): The type 'IList<>' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
FakeFactory.cs (20, 68): The type 'ICollection<>' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
FakeFactory.cs (20, 68): The type 'IEnumerable<>' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
FakeFactory.cs (20, 68): The type 'IEnumerable' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
FakeFactory.cs (20, 59): 'ServiceProvider ServiceCollectionContainerBuilderExtensions.BuildServiceProvider(IServiceCollection)' has the wrong return type
FakeFactory.cs (20, 59): The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
FakeFactory.cs (20, 59): The type 'IServiceProvider' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
FakeFactory.cs (20, 59): The type 'IDisposable' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
FakeFactory.cs (72, 24): The type 'ConstructorInfo' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
SubjectFactory.cs (61, 33): The type 'ConstructorInfo' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
SubjectFactory.cs (63, 20): The type 'ConstructorInfo' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.



Yes, it builds and runs find on my local machine with NCrunch. And builds fine on the grid node with 'dotnet build'.

I deleted all Build Folders from the Grid Node Server, did not help.

.NET Core 1.1/Standard 1.x are building and testing fine on the same system.
Der-Albert.com
#54 Posted : Friday, September 08, 2017 7:11:21 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 5/17/2011(UTC)
Posts: 102

Was thanked: 16 time(s) in 14 post(s)
3.12.1 does not fix this problem. Also, i'm sure .NET Standard 2.0 Builds worked in an earlier version of 3.11 and the same machine. Now we moved all our .NET Core/.NET Standard Projects to 2.0 and i have to run the test locally on my machine instead of the node. which hurts the performance a little bit.

Anything you need from me to solve this?
Remco
#55 Posted : Friday, September 08, 2017 7:53:15 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 664 times
Was thanked: 782 time(s) in 744 post(s)
Can you confirm whether the grid node is running as local system, or a user account? I remember encountering some strange behaviour when trying to build and run tests under the system profile, because this stores the nuget package cache under Windows\System32 (a bad thing).

Of interest is also whether the projects situated in the NCrunch workspace on the grid node can be built using command-line MSBuild.exe. Trying to get them to build and comparing them with their foreground equivalents is a good way to troubleshoot this problem, as you can deductively figure out where NCrunch has gone wrong in setting up these files.

Because grid processing under .NET standard 2.0 seems to be working for all my test cases, I believe there is a fundamental different in the environment on your grid node that must be triggering this issue. If we can find this difference, I should be able to reproduce and resolve the issue.
Der-Albert.com
#56 Posted : Friday, September 08, 2017 8:25:56 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 5/17/2011(UTC)
Posts: 102

Was thanked: 16 time(s) in 14 post(s)
Hi Remco,

of course .... first thought "Running not as a Service, i switched that to the Local User Account and it worked".... well, lets take a look to be sure. No, is running under local System. WTF.

So one of the Upgrade Installs, uninstalls, and reinstalls killed the LogOn Account Data which i entered some time ago. I entered it again. and now it works.

Maybe you should ask for account data while the installation (or do you?).
Remco
#57 Posted : Friday, September 08, 2017 8:30:35 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 664 times
Was thanked: 782 time(s) in 744 post(s)
Der-Albert.com;11166 wrote:

of course .... first thought "Running not as a Service, i switched that to the Local User Account and it worked".... well, lets take a look to be sure. No, is running under local System. WTF.

So one of the Upgrade Installs, uninstalls, and reinstalls killed the LogOn Account Data which i entered some time ago. I entered it again. and now it works.

Maybe you should ask for account data while the installation (or do you?).


Sorry, the installer always sets the user to the local system account, even for upgrades, annoyingly. There is a task in the backlog to address this. I guess now that we have a major platform that doesn't run under local system, the task is becoming more urgent. For the time being, this is one to watch out for when you upgrade the grid node.
GreenMoose
#58 Posted : Friday, September 08, 2017 9:16:08 AM(UTC)
Rank: Advanced Member

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

Thanks: 55 times
Was thanked: 36 time(s) in 35 post(s)
Remco;11167 wrote:
Der-Albert.com;11166 wrote:

of course .... first thought "Running not as a Service, i switched that to the Local User Account and it worked".... well, lets take a look to be sure. No, is running under local System. WTF.

So one of the Upgrade Installs, uninstalls, and reinstalls killed the LogOn Account Data which i entered some time ago. I entered it again. and now it works.

Maybe you should ask for account data while the installation (or do you?).


Sorry, the installer always sets the user to the local system account, even for upgrades, annoyingly. There is a task in the backlog to address this. I guess now that we have a major platform that doesn't run under local system, the task is becoming more urgent. For the time being, this is one to watch out for when you upgrade the grid node.

FWIW https://ncrunch.uservoic...rvice-settings-for-grid :P
Remco
#59 Posted : Friday, September 08, 2017 11:30:30 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 664 times
Was thanked: 782 time(s) in 744 post(s)
I'm going to lock this topic now, because it's becoming a catch-all for every problem even vaguely related to .NET Core and .NET Standard. I hope that we're most of the way there now towards full compatibility with this platform. If anyone is still experiencing problems, please create a new thread with a more specific topic to report the problem. Thanks!
Users browsing this topic
Guest (3)
3 Pages<123
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.133 seconds.