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: Member

Groups: Registered
Joined: 11/23/2012(UTC)
Posts: 29
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: 6,636

Thanks: 873 times
Was thanked: 1184 time(s) in 1104 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: 252
Location: Netherlands

Thanks: 109 times
Was thanked: 57 time(s) in 54 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: Member

Groups: Registered
Joined: 11/23/2012(UTC)
Posts: 29
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)
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.037 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download