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

Notification

Icon
Error

FrameworkReference Build Error on a netcoreapp2.1 Target Build
Silvenga
#1 Posted : Thursday, January 2, 2020 5:20:18 PM(UTC)
Rank: Member

Groups: Registered
Joined: 1/24/2016(UTC)
Posts: 25
Location: United States of America

Sorry, this is actually what I was coming here is ask about - https://forum.ncrunch.ne...nException-Looping.aspx was just a minor annoyance I've been encounting for months that made it hard to make a test case for this issue.

Something odd is happening with a csproj that looks like this:

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

  <PropertyGroup>
    <TargetFrameworks>netcoreapp2.1;netcoreapp3.0</TargetFrameworks>
  </PropertyGroup>

  <ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
    <PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="3.0.0" />
  </ItemGroup>

  <ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.1'">
    <PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="2.1.0" />
  </ItemGroup>

</Project>


The build for netcoreapp3.0 succeeds, but the build for netcoreapp2.1 fails with:

Code:
NCrunch: If you are experiencing problems in getting this project to build, have a look at http://www.ncrunch.net/documentation/troubleshooting_project-build-issues
NCrunch: This project was built on server '(local)'
C:\Program Files\dotnet\sdk\3.1.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets: The FrameworkReference 'Microsoft.AspNetCore.App' was not recognized


Which seems supper odd, considering this is a .Net Core 2.1 project, before FrameworkReference existed.

Digging deeper, it appears this build target is failing only if netcoreapp3.0 is included in the framework target list. This makes me think NCrunch is possibly leaking project build state (if that's a thing) between target builds.
Remco
#2 Posted : Friday, January 3, 2020 11:43:48 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 787 times
Was thanked: 1023 time(s) in 974 post(s)
Thanks for sharing this problem.

Quote:
Which seems supper odd, considering this is a .Net Core 2.1 project, before FrameworkReference existed.


Unfortunately, the new tooling introduced with .NET Core 3.0 has replaced the existing build system for .NET Core 2.1. Merely by having the new tooling installed, your system for 2.1 will also change.

I'm not completely sure what is happening here. The build system is doing something very unexpected under the hood here. We'll need to do some digging to try and figure this out. The good news is that we're able to reproduce the issue consistently using your code sample, so hopefully it should just be a matter of time.
michaelkroes
#3 Posted : Monday, January 6, 2020 7:12:28 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 94 times
Was thanked: 45 time(s) in 43 post(s)
Silvenga
#4 Posted : Thursday, April 9, 2020 8:41:51 PM(UTC)
Rank: Member

Groups: Registered
Joined: 1/24/2016(UTC)
Posts: 25
Location: United States of America

Sorry, the holidays and the resulting context switch had me space on this.

I did try those builds (3 months ago), no change. I've since updated to newer release, and the issue does still exist. It's not 100% consistent though, and sometimes works. I think it's related to https://forum.ncrunch.ne...nException-Looping.aspx - since it only occurs after csproj modifications.
Remco
#5 Posted : Saturday, April 11, 2020 4:03:44 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 787 times
Was thanked: 1023 time(s) in 974 post(s)
Silvenga;14596 wrote:
Sorry, the holidays and the resulting context switch had me space on this.

I did try those builds (3 months ago), no change. I've since updated to newer release, and the issue does still exist. It's not 100% consistent though, and sometimes works. I think it's related to https://forum.ncrunch.ne...nException-Looping.aspx - since it only occurs after csproj modifications.


I'm sorry to hear this. Do you have a sample solution you can share with us that can reproduce the problem, even inconsistently? You can submit small sample projects in ZIP form through the NCrunch contact form.

It may also be worth clearing out the 'obj' directories under your projects to see if that resolves the inconsistency. It could be old data doing this to you.
Silvenga
#6 Posted : Tuesday, April 14, 2020 8:13:30 PM(UTC)
Rank: Member

Groups: Registered
Joined: 1/24/2016(UTC)
Posts: 25
Location: United States of America

I'll try to make a small repo case, thanks.
Silvenga
#7 Posted : Monday, April 20, 2020 7:26:12 PM(UTC)
Rank: Member

Groups: Registered
Joined: 1/24/2016(UTC)
Posts: 25
Location: United States of America

I've managed to create 4 reproduction cases relevant to this. I've uploaded a ZIP.
Remco
#8 Posted : Monday, April 20, 2020 11:53:46 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 787 times
Was thanked: 1023 time(s) in 974 post(s)
Thanks for sending these through. I'll take a look and will get back to you as soon as I have more information.
Remco
#9 Posted : Wednesday, April 22, 2020 2:35:28 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 787 times
Was thanked: 1023 time(s) in 974 post(s)
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.069 seconds.