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

Notification

Icon
Error

WPF projects don't compile anymore when dotnet7 is installed
DeltaEngine
#1 Posted : Friday, September 2, 2022 12:21:49 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 11/23/2012(UTC)
Posts: 31
Location: Germany

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

Even with the latest NCrunch release (4.14.0.7) we still have the issue on ANY WPF project (.NET6 or .NET7, doesn't matter) that NCrunch build throws an error:

C:\Program Files\dotnet\sdk\7.0.100-preview.6.22352.1\Sdks\Microsoft.NET.Sdk.WindowsDesktop\targets\Microsoft.WinFX.targets (211): Unknown build error, 'Method 'GetGenericInstantiation' in type 'System.Reflection.TypeLoading.Ecma.EcmaModule' from assembly 'System.Reflection.MetadataLoadContext, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' does not have an implementation.'

The "fix" is to add a global.json file in the project folder to switch dotnet back to version 6.0.400:
{
"sdk": {
"version": "6.0.400",
"rollForward": "latestFeature"
}
}

Now WPF and Ncrunch are happy for .NET6 project, but obviously no .NET7 projects can be compiled anymore when switching the dotnet tool to .NET6.

Not sure if this has anything to do with NCrunch (probably some issue with dotnet command line tool), but all other things (dotnet build, test, etc. console stuff, Visual Studio, ReSharper) all work fine with .NET7 and WPF projects.

Thanks
Remco
#2 Posted : Friday, September 2, 2022 1:00: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)
Hi, thanks for sharing this issue.

Right now we don't have any support for NET7. It's still too early for us to handle this one. We'll be performing more QA and troubleshooting on this one closer to its release date.
michaelkroes
#3 Posted : Friday, September 16, 2022 7:00:43 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 138 times
Was thanked: 73 time(s) in 69 post(s)
2 users thanked michaelkroes for this useful post.
DeltaEngine on 9/23/2022(UTC), egilgamesh on 9/23/2022(UTC)
DeltaEngine
#4 Posted : Friday, September 23, 2022 3:00:26 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 11/23/2012(UTC)
Posts: 31
Location: Germany

Thanks: 8 times
Was thanked: 3 time(s) in 3 post(s)
Thanks for the update and build that fixes the issue, works perfect in our big solutions, now we can fully switch to .net 7.
1 user thanked DeltaEngine for this useful post.
Remco on 9/23/2022(UTC)
egilgamesh
#5 Posted : Tuesday, September 27, 2022 4:20:33 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 9/1/2022(UTC)
Posts: 3
Location: Germany

Thanks: 1 times
Thanks michaelkroes for your kind reply, so far the main problem that related to WPF has been solved with this shared build,

but we get a new problem and this stopped Ncrunch to work correctly, please check the below error, even though our projects use .net 7 on machines that have .net7 SDKs

we tried several solution even we reinstalled everything from scratch but the problem doesn't solve





System.Exception: An exception was thrown in the remote environment: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> nCrunch.Common.UserException: Errors occurred while trying to load the project file:
The current .NET SDK does not support targeting .NET 7.0. Either target .NET 6.0 or lower, or use a version of the .NET SDK that supports .NET 7.0.
at nCrunch.Compiler.ComponentAnalysisContext. ()
at nCrunch.Compiler.ComponentAnalysisContext.AnalyseComponentBuild()
at nCrunch.Compiler.RemoteBuildRunner.AnalyseComponentBuild(ComponentLoadParameters parameters)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at nCrunch.TaskRunner.Ipc.IpcMessageProcessor. (CallMethodMessage )
at nCrunch.TaskRunner.Ipc.IpcMessageProcessor.ProcessMessageReturningResult(Byte[] data)
at nCrunch.TaskRunner.Ipc.RemoteProxyCommunicator. (Byte[] )
at nCrunch.TaskRunner.Ipc.RemoteProxyCommunicator.Invoke(String methodName, Object[] args)
at nCrunch.Compiler.RemoteBuildRunnerProxy.AnalyseComponentBuild(ComponentLoadParameters parameters)
at nCrunch.Core.BuildManagement.BuildProcessLauncher. . (IRemoteBuildRunner )
at nCrunch.Core.BuildManagement.BuildProcessLauncher. (Action`1 , FilePath , String , ExternalProcess )
at nCrunch.Core.BuildManagement.BuildProcessLauncher. (Action`1 , EffectiveProcessorArchitecture , GridClientId , BuildSystemParameters , IList`1 , Nullable`1 , GridAddress , DotNetCoreSdkVersion )
at nCrunch.Core.BuildManagement.BuildProcessLauncher.AnalyseComponentBuildInExternalProcess(ComponentLoadParameters parameters, IList`1 customEnvironmentVariables)
at nCrunch.Client.ComponentLoader.SnapshotComponentLoader. (EffectiveProcessorArchitecture , String )
at nCrunch.Client.ComponentLoader.SnapshotComponentLoader.CreateComponentFromXml(FilePath projectFilePath, ParsedBuildXml projectXml, FilePath solutionFilePath, String[] additionalFilesToIncludeAtSolutionLevel, Boolean isLoadedFromFile, IDEVersion vsVersion, ComponentUniqueName componentName, TaskSettings componentTaskSettings, Exception parseException, String targetFrameworkForMsbuild, String visibleTargetFramework)
Remco
#6 Posted : Tuesday, September 27, 2022 11:35:44 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, sorry to hear there's another issue here.

Is this something you can reproduce with a sample project that you can share with us? Right now we don't know how to produce this problem.
egilgamesh
#7 Posted : Wednesday, September 28, 2022 4:09:10 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 9/1/2022(UTC)
Posts: 3
Location: Germany

Thanks: 1 times
unfortunately, it is unexpected behavior, and doesn't happen on all PCs,

but using global.json file solve this problem in some cases
Remco
#8 Posted : Wednesday, September 28, 2022 11:10:19 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)
Is it possible the machines are running different versions of the NET7 SDK?

Are these machines able to run any kind of NET7 application? i.e. if you build a console app referencing a NET7 project, does it run?
egilgamesh
#9 Posted : Friday, September 30, 2022 1:12:46 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 9/1/2022(UTC)
Posts: 3
Location: Germany

Thanks: 1 times
Thanks for your reply, these machines have already .Net7, we tried with a simple class library project but the problem same.

We decide later to do clean windows OS installation for these machines, and the problem is gone, is there any cache/ Registry record files need to consider when we remove Ncrunch from Machine?
Remco
#10 Posted : Friday, September 30, 2022 11:23:05 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)
egilgamesh;16293 wrote:

We decide later to do clean windows OS installation for these machines, and the problem is gone, is there any cache/ Registry record files need to consider when we remove Ncrunch from Machine?


The NCrunch uninstaller should take care of anything relevant here.

I suspect this issue may be down to the install state of a preview platform. Glad to hear you've resolved the issue. Nice work!
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.081 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download