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

Notification

Icon
Error

.NET Core 3.1 - The FrameworkReference 'Microsoft.NETCore.App' was not recognized
mattyboy
#1 Posted : Friday, December 13, 2019 3:09:36 AM(UTC)
Rank: Member

Groups: Registered
Joined: 7/2/2015(UTC)
Posts: 16
Location: United Kingdom

Thanks: 4 times
Was thanked: 4 time(s) in 4 post(s)
Today I upgraded my .NET Core 2.2 application to 3.1. My solution builds fine in Visual Studio but NCrunch fails to compile my application.

..\..\..\..\..\..\Program Files\dotnet\sdk\3.1.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets (283, 5): The FrameworkReference 'Microsoft.NETCore.App' was not recognized
..\..\..\..\..\..\Program Files\dotnet\sdk\3.1.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets (283, 5): The FrameworkReference 'Microsoft.AspNetCore.App' was not recognized



PS. I did not explicitly install the .NET 3.1 SDK, it is automatically included in Visual Studio 2019 16.4.1.

Matt
1 user thanked mattyboy for this useful post.
michaelkroes on 12/14/2019(UTC)
michaelkroes
#2 Posted : Friday, December 13, 2019 3:34:55 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 136 times
Was thanked: 70 time(s) in 67 post(s)
Hi!

Thanks for posting. We are currently looking into this.

Could you confirm this project is using the Swashbuckle.AspNetCore.Filters package?

Michael
mattyboy
#3 Posted : Friday, December 13, 2019 5:52:33 AM(UTC)
Rank: Member

Groups: Registered
Joined: 7/2/2015(UTC)
Posts: 16
Location: United Kingdom

Thanks: 4 times
Was thanked: 4 time(s) in 4 post(s)
Hi Michael

Yes, it is using that package. In fact, I am the author of that package! Is there something wrong with it?

Matt
1 user thanked mattyboy for this useful post.
michaelkroes on 12/14/2019(UTC)
mattyboy
#5 Posted : Friday, December 13, 2019 6:01:43 AM(UTC)
Rank: Member

Groups: Registered
Joined: 7/2/2015(UTC)
Posts: 16
Location: United Kingdom

Thanks: 4 times
Was thanked: 4 time(s) in 4 post(s)
Hmm, so before I opened this thread I thought I'd try rebooting my laptop "just in case", but NCrunch still didn't work.

But now, when I booted up my laptop again and opened the solution, NCrunch is happy and works. Not sure why.

Happy to close this for now... maybe there is an issue when people are following the upgrade path for the first time?

e.g. today I
1. opened up VS 2019 16.3.something
2. opened my .NET Core 2.2 solution
3. upgraded VS to 16.4.1 which also installed the .NET Core SDK 3.1
4. reopened VS, migrated my solution to .NET Core 3.1. NCrunch failed with the above error.
5. Rebooted my laptop, opened solution again, NCrunch still failed to build.
6. Shutdown laptop
7. Booted laptop, opened solution again, NCrunch happy now.

Good luck trying to reproduce that haha!

Matt
1 user thanked mattyboy for this useful post.
michaelkroes on 12/14/2019(UTC)
michaelkroes
#4 Posted : Friday, December 13, 2019 10:22:39 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 136 times
Was thanked: 70 time(s) in 67 post(s)
mattyboy;14218 wrote:
Hi Michael

Yes, it is using that package. In fact, I am the author of that package! Is there something wrong with it?

Matt



Thanks for confirming this. We have been able to reproduce this consistently.

The package does something which works when building the software from within Visual Studio but not under NCrunch.

On this line an explicit reference to the framework is added. With aspnetcore 3 MS added the concept of transitive references. From what I can see this normal FrameworkReference was added in the package during the preview phase. Maybe not everything was working as expected then. I haven't looked very deep into this, but I don't believe this is a recommended practice.

To bring NCrunch in line with how VS handles these added references we will now detect these explicitly defined FrameworkReferences and when we detect them we will no longer copy the transitive references discovered during the analysis.

Thanks for the help and bug reports, this is very much appreciated :)

michaelkroes
#6 Posted : Saturday, December 14, 2019 7:12:39 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 136 times
Was thanked: 70 time(s) in 67 post(s)
The release that fixes this issue is live: https://www.ncrunch.net/download.
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.038 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download