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

Notification

Icon
Error

DispatcherScheduler.Current
Dirk Maegh
#1 Posted : Wednesday, December 23, 2020 11:09:02 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 11/30/2016(UTC)
Posts: 55
Location: Belgium

Thanks: 8 times
Was thanked: 8 time(s) in 8 post(s)
Hi,

in an XUnit TestProject for .Net Core 5.0, I have a reference to DispatcherScheduler.Current, which should live in namespace System.Reactive.Concurrency.
Since I also work with a reference to a WPF project, to test the viewmodels, I need to get the target framework as
Quote:

<PropertyGroup>
<TargetFramework>net5.0-windows</TargetFramework>
</PropertyGroup>


When referencing the package System.Reactive v4.4.1, I noticed that Resharper decompiled the class as (mark the #if !WINDOWS ?!)
Quote:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT License.
// See the LICENSE file in the project root for more information.

#if !WINDOWS
using System.Reactive.Disposables;
using System.Threading;

namespace System.Reactive.Concurrency
{
/// <summary>
/// Represents an object that schedules units of work on a <see cref="Windows.Threading.Dispatcher"/>.
/// </summary>
/// <remarks>
/// This scheduler type is typically used indirectly through the <see cref="Linq.DispatcherObservable.ObserveOnDispatcher{TSource}(IObservable{TSource})"/> and <see cref="Linq.DispatcherObservable.SubscribeOnDispatcher{TSource}(IObservable{TSource})"/> methods that use the Dispatcher on the calling thread.
/// </remarks>
public class DispatcherScheduler : LocalScheduler, ISchedulerPeriodic


When checking out the package in VS Object Browser, I don't see the class, nor does it compile. It should be there however.

Then I upgraded to package System.Reactive v5.0, however to no avail.
So I googled some, and found https://github.com/dotnet/reactive/issues/1423
I noticed another specific Windows target framework, and changed mine as well

Quote:

<PropertyGroup>
<TargetFramework>net5.0-windows10.0.19041</TargetFramework>
</PropertyGroup>


Now VS2019 compiles it all, no problem.
Resharper recognizes all as being well.

But NCrunch does not want to compile it.
It says

Quote:


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.(EffectiveProcessorArchitecture , 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 , CustomVariable[] )
at nCrunch.Core.TestManagement.TestRunnerProcess..()
at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
at nCrunch.Core.TestManagement.TestRunnerProcess.LoadTestRunnerProcessForProjectReturningProcessId(SnapshotComponent snapshotComponent, IList`1 componentsInProcess, TestFrameworkDescription[] testingFrameworks, Nullable`1 newProcessTag, FilePath solutionFilePath, GridClientId client, CustomVariable[] customEnvironmentVariables)
at nCrunch.Core.Processing.AnalysisTaskLogic.DoProcessTaskAndReturnSuccessFlag()


Is there something I can do about this ? Or you :) ?

Thanks for your investigation !

Dirk
Remco
#2 Posted : Wednesday, December 23, 2020 11:40:37 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi Dirk,

Thanks for sharing this problem. Can you check this new troubleshooting page to see if any of the listed issues apply to your situation? It's not normal for a test process to suddenly disappear right after its started.
Dirk Maegh
#3 Posted : Saturday, December 26, 2020 6:41:12 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 11/30/2016(UTC)
Posts: 55
Location: Belgium

Thanks: 8 times
Was thanked: 8 time(s) in 8 post(s)
Hi,

I just retested the same thing with Resharper (be it on a different computer, NCrunch gives me the same error output, being nCrunch.TaskRunner.Ipc.IpcConnectionClosedException: The connection has been closed) - they have no problem with the project and the test. So I think all necessary requirements are fulfilled.
So going through the page you would like me to go through:
Targeted version of .NET is not installed => I think it is installed, because other dotnet tools run and resharper UnitTest runner can run it.
A critical .NET package is not installed => Should also be ok, since another tool can run the test
OutOfMemoryException => can be the case, but the NCrunch problem lies in compiling the project, not (yet) running it.
Process corruption or unstable runtime => does not refer to compilation issue I guess ?

So far I recognize nothing that should have anything to do with my computer, also I can repeat the problem on another computer (my desktop, heaps of space and memory)

How should I proceed please ?

Thanks for your views :)
Remco
#4 Posted : Saturday, December 26, 2020 11:36:26 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Can you reproduce this problem in a sample solution you can share with me? You can submit code through the NCrunch contact form.
Dirk Maegh
#5 Posted : Monday, December 28, 2020 2:50:28 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 11/30/2016(UTC)
Posts: 55
Location: Belgium

Thanks: 8 times
Was thanked: 8 time(s) in 8 post(s)
Hello,

today I was just trying to create a sample solution.
I created an XUnit Test project, using VS2019, all latest upgrade.

I copied over the project details from my "faulty" project (the one that nCrunch seems to be unable to build, omitting any content files etc.).

The result is I have an empty project, with the following content in the csproj:

Quote:

<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0-windows10.0.19041</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
<PackageReference Include="System.Reactive" Version="5.0.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="1.3.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>


</Project>


I did have a "default" unittest file, but ncrunch had a problem with the project.

Quote:

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.(EffectiveProcessorArchitecture , 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 , CustomVariable[] )
at nCrunch.Core.TestManagement.TestRunnerProcess..()
at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
at nCrunch.Core.TestManagement.TestRunnerProcess.LoadTestRunnerProcessForProjectReturningProcessId(SnapshotComponent snapshotComponent, IList`1 componentsInProcess, TestFrameworkDescription[] testingFrameworks, Nullable`1 newProcessTag, FilePath solutionFilePath, GridClientId client, CustomVariable[] customEnvironmentVariables)
at nCrunch.Core.Processing.AnalysisTaskLogic.DoProcessTaskAndReturnSuccessFlag()


This seems already similar enough. Even if I remove the default unit test, same problem remains.

Will this do, or shall I send the file itself (just create a file "NCrunchSample.csproj" and paste in the content, and you should have it ?

Thanks,
Dirk
Remco
#6 Posted : Monday, December 28, 2020 11:53:12 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Thanks for your guidance. I've managed to produce a problem using the project structure you've provided. On my machine, it looks like the problem is related to the targeted platform not being installed on my machine.

I've included the error log below, and I've updated the documentation to include instructions on how to obtain this log in case anyone else gets hit with this problem. We have a task scoped right now to improve the error reporting here, as needing to dive through logs like this isn't an acceptable experience when trying to troubleshoot a common problem like this one.

Anyway, I recommend checking the link in the error log to see whether you have this specific platform version installed.

[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: Tracing enabled @ Mon Dec 28 23:37:52 2020 GMT
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: --- Invoked dotnet [version: 5.0.0, commit hash: cf258a14b70ad9069470a108f13765e0e5988f51] main = {
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: C:\Program Files\dotnet\dotnet.exe
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: F:\Workspaces\14296\2\bin\Debug\net5.0-windows10.0.19041\nCrunch.TaskRunner.DotNetCore.20.x64.dll
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: 14296
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: nCrunch_2a36ce6ad80e4f4ca5694e9e49e2151b
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: 0c3d5466f3704d6fba46776e19db594b
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: c:\program files (x86)\microsoft visual studio\2019\enterprise\common7\ide\extensions\remco software\ncrunch for visual studio 2019\nCrunch.TestExecution.DotNetCore.dll
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: nCrunch.TestExecution.RemoteTaskRunner
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: F:\Workspaces\14296\2\bin\Debug\net5.0-windows10.0.19041
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: False
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: F:\Workspaces\14296\2\bin\Debug\net5.0-windows10.0.19041\project.dll.config.ncrunchconfig
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: }
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: Reading fx resolver directory=[C:\Program Files\dotnet\host\fxr]
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: Considering fxr version=[1.0.5]...
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: Considering fxr version=[1.1.2]...
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: Considering fxr version=[1.1.9]...
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: Considering fxr version=[2.0.0]...
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: Considering fxr version=[2.0.3]...
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: Considering fxr version=[2.0.5]...
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: Considering fxr version=[2.0.7]...
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: Considering fxr version=[2.0.9]...
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: Considering fxr version=[2.1.0]...
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: Considering fxr version=[2.1.11]...
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: Considering fxr version=[2.1.12]...
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: Considering fxr version=[2.1.16]...
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: Considering fxr version=[2.1.2]...
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: Considering fxr version=[2.1.6]...
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: Considering fxr version=[2.1.9]...
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: Considering fxr version=[2.2.1]...
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: Considering fxr version=[2.2.4]...
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: Considering fxr version=[2.2.6]...
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: Considering fxr version=[3.1.3]...
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: Considering fxr version=[5.0.0]...
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: Detected latest fxr version=[C:\Program Files\dotnet\host\fxr\5.0.0]...
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: Resolved fxr [C:\Program Files\dotnet\host\fxr\5.0.0\hostfxr.dll]...
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: Loaded library from C:\Program Files\dotnet\host\fxr\5.0.0\hostfxr.dll
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: Invoking fx resolver [C:\Program Files\dotnet\host\fxr\5.0.0\hostfxr.dll] hostfxr_main_startupinfo
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: Host path: [C:\Program Files\dotnet\dotnet.exe]
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: Dotnet path: [C:\Program Files\dotnet\]
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: App path: [C:\Program Files\dotnet\dotnet.dll]
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: Tracing enabled @ Mon Dec 28 23:37:52 2020 GMT
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: --- Invoked hostfxr_main_startupinfo [commit hash: cf258a14b70ad9069470a108f13765e0e5988f51]
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: Checking if CoreCLR path exists=[C:\Program Files\dotnet\coreclr.dll]
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: --- Executing in muxer mode...
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: Using the provided arguments to determine the application to execute.
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: Using dotnet root path [C:\Program Files\dotnet\]
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: App runtimeconfig.json from [F:\Workspaces\14296\2\bin\Debug\net5.0-windows10.0.19041\nCrunch.TaskRunner.DotNetCore.20.x64.dll]
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: Runtime config is cfg=F:\Workspaces\14296\2\bin\Debug\net5.0-windows10.0.19041\nCrunch.TaskRunner.DotNetCore.20.x64.runtimeconfig.json dev=F:\Workspaces\14296\2\bin\Debug\net5.0-windows10.0.19041\nCrunch.TaskRunner.DotNetCore.20.x64.runtimeconfig.dev.json
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: Attempting to read runtime config: F:\Workspaces\14296\2\bin\Debug\net5.0-windows10.0.19041\nCrunch.TaskRunner.DotNetCore.20.x64.runtimeconfig.json
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: Attempting to read dev runtime config: F:\Workspaces\14296\2\bin\Debug\net5.0-windows10.0.19041\nCrunch.TaskRunner.DotNetCore.20.x64.runtimeconfig.dev.json
[PID:14296 12:37:52.3577 ProcessOutputRedirectionErr-69] Process 3012: Runtime config [F:\Workspaces\14296\2\bin\Debug\net5.0-windows10.0.19041\nCrunch.TaskRunner.DotNetCore.20.x64.runtimeconfig.json] is valid=[1]
[PID:14296 12:37:52.3727 ProcessOutputRedirectionErr-69] Process 3012: --- The specified framework 'Microsoft.Windows.SDK.NET.Ref', version '10.0.19041.10', apply_patches=1, version_compatibility_range=minor is compatible with the previously referenced version '10.0.19041.10'.
[PID:14296 12:37:52.3727 ProcessOutputRedirectionErr-69] Process 3012: --- Resolving FX directory, name 'Microsoft.Windows.SDK.NET.Ref' version '10.0.19041.10'
[PID:14296 12:37:52.3727 ProcessOutputRedirectionErr-69] Process 3012: Multilevel lookup is true
[PID:14296 12:37:52.3727 ProcessOutputRedirectionErr-69] Process 3012: Searching FX directory in [C:\Program Files\dotnet]
[PID:14296 12:37:52.3727 ProcessOutputRedirectionErr-69] Process 3012: Attempting FX roll forward starting from version='[10.0.19041.10]', apply_patches=1, version_compatibility_range=minor, roll_to_highest_version=0, prefer_release=1
[PID:14296 12:37:52.3727 ProcessOutputRedirectionErr-69] Process 3012: 'Roll forward' enabled with version_compatibility_range [minor]. Looking for the lowest release greater than or equal version to [10.0.19041.10]
[PID:14296 12:37:52.3727 ProcessOutputRedirectionErr-69] Process 3012: No match greater than or equal to [10.0.19041.10] found.
[PID:14296 12:37:52.3727 ProcessOutputRedirectionErr-69] Process 3012: 'Roll forward' enabled with version_compatibility_range [minor]. Looking for the lowest release/pre-release greater than or equal version to [10.0.19041.10]
[PID:14296 12:37:52.3727 ProcessOutputRedirectionErr-69] Process 3012: No match greater than or equal to [10.0.19041.10] found.
[PID:14296 12:37:52.3727 ProcessOutputRedirectionErr-69] Process 3012: Framework reference didn't resolve to any available version.
[PID:14296 12:37:52.3727 ProcessOutputRedirectionErr-69] Process 3012: It was not possible to find any compatible framework version
[PID:14296 12:37:52.3727 ProcessOutputRedirectionErr-69] Process 3012: Multilevel lookup is true
[PID:14296 12:37:52.3727 ProcessOutputRedirectionErr-69] Process 3012: The framework 'Microsoft.Windows.SDK.NET.Ref', version '10.0.19041.10' was not found.
[PID:14296 12:37:52.3727 ProcessOutputRedirectionErr-69] Process 3012: - No frameworks were found.
[PID:14296 12:37:52.3727 ProcessOutputRedirectionErr-69] Process 3012:
[PID:14296 12:37:52.3727 ProcessOutputRedirectionErr-69] Process 3012: You can resolve the problem by installing the specified framework and/or SDK.
[PID:14296 12:37:52.3727 ProcessOutputRedirectionErr-69] Process 3012:
[PID:14296 12:37:52.3727 ProcessOutputRedirectionErr-69] Process 3012: The specified framework can be found at:
[PID:14296 12:37:52.3727 ProcessOutputRedirectionErr-69] Process 3012: - https://aka.ms/dotnet-co...ch=x64&rid=win10-x64
1 user thanked Remco for this useful post.
UppSol on 12/29/2020(UTC)
Dirk Maegh
#7 Posted : Wednesday, December 30, 2020 6:43:41 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 11/30/2016(UTC)
Posts: 55
Location: Belgium

Thanks: 8 times
Was thanked: 8 time(s) in 8 post(s)
Hi,

thanks for your updated documentation. I managed to get this result:

Quote:

ENGINE - [19:24:35.4155-ProcessOutputRedirectionErr-56] Process 21900: You can resolve the problem by installing the specified framework and/or SDK.
ENGINE - [19:24:35.4155-ProcessOutputRedirectionErr-56] Process 21900:
ENGINE - [19:24:35.4155-ProcessOutputRedirectionErr-56] Process 21900: The specified framework can be found at:
ENGINE - [19:24:35.4155-ProcessOutputRedirectionErr-56] Process 21900: - https://aka.ms/dotnet-co...h=x64&rid=win10-x64


But when I click the link, it just sends me to the following (normal) dotnet core download...
https://dotnet.microsoft...amp;utm_medium=referral

But even if I could find this by ncrunch referenced framework, why does VS2019 compile it ok ? Why can Resharper successfully build and run the unittests ?

I just added a simple test to the sample project (so now I have one file with the project, one file with a test class)

Quote:

using Xunit;
using Xunit.Abstractions;

namespace NCrunchSample
{
public class SimpleTest
{
private readonly ITestOutputHelper _testOutputHelper;

public SimpleTest(ITestOutputHelper testOutputHelper)
{
_testOutputHelper = testOutputHelper;
}
[Fact]
public void Test()
{
_testOutputHelper.WriteLine("OK");
}
}
}


VS2019 still compiles this project fine, and when checking the VS2019 Test Explorer, I can run this test - all is well.

So do I really need another SDK ? Did I understand your reply correct ?

Please advise.

Thanks,
Dirk
Remco
#9 Posted : Wednesday, December 30, 2020 11:51:47 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Code:
<TargetFramework>net5.0-windows10.0.19041</TargetFramework>


When you use the line above, you tell the build system and runtime that you want to use a very specific version of the platform.

The specific version of the platform you are targeting is not installed on your machine. So the runtime is correct to give this error. It's a shame that they didn't implement the download link correctly to let you install the version you're after.

I can't speak for the behaviour of other runners. We have noticed previously that other runners can switch to a different version of the runtime internally depending on what is installed or how they are implemented. We have no intention of doing this as we feel it is incorrect behaviour that has the potential to mask problems.

To solve this problem you either need to use a more generic platform target (i.e. 'net5.0') or you need to make sure you have the precise version of the targeted platform installed. Sorry, I can't provide a download link for this .. MS sites are a maze for me also.
2 users thanked Remco for this useful post.
Dirk Maegh on 12/31/2020(UTC), UppSol on 12/31/2020(UTC)
Dirk Maegh
#10 Posted : Saturday, January 2, 2021 5:32:08 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 11/30/2016(UTC)
Posts: 55
Location: Belgium

Thanks: 8 times
Was thanked: 8 time(s) in 8 post(s)
Hi,

I searched google just now, and found the following link - which seems to be the SDK for 10.0.19041.0.
https://go.microsoft.com/fwlink/p/?linkid=2120843

Since NCrunch wants to get it all right, I am a bit inclined to install this on my system.
I would like to check whether this solves the problem, but installing all of it seems a bit like overkill.
Would you know which part is needed to solve the dependency ? Or should I install it all anyway ?

Thx for your views.
Remco
#11 Posted : Saturday, January 2, 2021 7:59:24 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Dirk Maegh;15216 wrote:

Since NCrunch wants to get it all right, I am a bit inclined to install this on my system.
I would like to check whether this solves the problem, but installing all of it seems a bit like overkill.
Would you know which part is needed to solve the dependency ? Or should I install it all anyway ?


Sorry, I can't advise on this. From the NCrunch point of view, the correct behaviour is to try to execute your tests with the specified platform, and to fail when this platform is not installed.

We will improve the error reporting so that in future it won't be necessary to run through trace logs to understand what is happening here.


EDIT: Hold fire on that installer. Something is not right here. I'll update you soon.
Remco
#12 Posted : Saturday, January 2, 2021 11:58:22 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
So it looks like we were getting this wrong.

It seems that when projects are built, the system should actually strip the target framework value down to its more generic form (i.e. 'net5.0') in preparation for the runtime. So the build system targets the more specific platform version, but the actual runtime doesn't care. Up until now, we've just been handing the specific runtime version downstream. Hence the error. I've implemented a fix in the build below if you'd like to give it a try. Sorry for the trouble.

NCrunch_Console_4.7.0.1.msi
NCrunch_Console_4.7.0.1.zip
NCrunch_GridNodeServer_4.7.0.1.msi
NCrunch_GridNodeServer_4.7.0.1.zip
NCrunch_LicenseServer_4.7.0.1.zip
NCrunch_VS2008_4.7.0.1.msi
NCrunch_VS2010_4.7.0.1.msi
NCrunch_VS2010_4.7.0.1.zip
NCrunch_VS2012_4.7.0.1.msi
NCrunch_VS2012_4.7.0.1.zip
NCrunch_VS2013_4.7.0.1.msi
NCrunch_VS2013_4.7.0.1.zip
NCrunch_VS2015_4.7.0.1.msi
NCrunch_VS2015_4.7.0.1.msi.7z
NCrunch_VS2015_4.7.0.1.zip
NCrunch_VS2017_4.7.0.1.msi
NCrunch_VS2017_4.7.0.1.msi.7z
NCrunch_VS2017_4.7.0.1.zip
NCrunch_VS2019_4.7.0.1.msi
NCrunch_VS2019_4.7.0.1.msi.7z
NCrunch_VS2019_4.7.0.1.zip
1 user thanked Remco for this useful post.
Dirk Maegh on 1/2/2021(UTC)
Dirk Maegh
#13 Posted : Saturday, January 2, 2021 9:34:58 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 11/30/2016(UTC)
Posts: 55
Location: Belgium

Thanks: 8 times
Was thanked: 8 time(s) in 8 post(s)
Hello,

that does the trick, thx for the great work !
1 user thanked Dirk Maegh for this useful post.
Remco on 1/2/2021(UTC)
warappa
#14 Posted : Monday, January 4, 2021 12:01:56 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 10/19/2016(UTC)
Posts: 5
Location: Austria

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
For your information:
4.7.0.1 also fixes a debug bug, but with .NET Core 3.1:
When I set a breakpoint, debugged a test and hit the breakpoint (which worked), trying to resume (i.e. hitting F5) triggered the "Sourcecode changed - edit or stop" message (paraphrased).

Restarting NCrunch/VS didn't help.

VS 2019 16.8.3
.NET Core 3.1
Optimized Mode
NCrunch 4.6.3 (bug), 4.7.0.1 (no bug)
Remco
#15 Posted : Monday, January 4, 2021 12:43:55 PM(UTC)
Rank: NCrunch Developer

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

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

The debugger in this area isn't under the control of NCrunch, and we made no change in the 4.7 build that would have affected this. This will be something in your VS that is probably behaving intermittently. If this is still happening for you, can you try the following to see if this makes a difference?

- In VS, click Tools->Options
- On the left tree, go to Debugging->General
- On the right pane, turn off 'Require source files to exactly match the original version'
Dirk Maegh
#16 Posted : Tuesday, January 5, 2021 3:08:53 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 11/30/2016(UTC)
Posts: 55
Location: Belgium

Thanks: 8 times
Was thanked: 8 time(s) in 8 post(s)
Hi,

As far as the debugger message “source code has changed”. - I have had the same situation.
But at that time I had that new setting configured for NCrunch instrumentation.

When I switched back to legacy, the debugger messages disappeared. So I stick to legacy for now ;)
Haven’t tried it with the new NCrunch version though...
Remco
#17 Posted : Tuesday, January 5, 2021 7:38:46 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
I'm interested in learning more about this problem in the hope that we might able to reproduce it.

Right now it has the feel of something intermittent. If you have a way to reproduce the problem, can you confirm whether turning off the previously mentioned 'Require source files to exactly match the original version' makes any difference?

I am also interested in whether the problem appears for you in small sample solutions in addition to the one you're currently working in.
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.199 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download