You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Using a ProjectReference which requires AssetTargetFallback to succeed, should warn. #7137
Microsoft Visual Studio Enterprise 2017 Int Preview (Dogfood)
Version 15.8.0 Preview 5.0 [27913.3.d15.8]
VisualStudio.15.IntPreview/15.8.0-pre.5.0+27913.3.d15.8
Microsoft .NET Framework
Version 4.7.03056
Repro steps
Add project reference from .NET Core project to .NET Framework 4.6.1 project
Restore / Build
Expected
Very similar warning to this for the PackageReference case
Warning NU1701 Package 'XAct.Wintellect.PowerCollections 0.0.1' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.1'. This package may not be fully compatible with your project. ConsoleApp30 C:\Users\nicholg\source\repos\ConsoleApp30\ConsoleApp30\ConsoleApp30.csproj 1
Actual
No warning
This defeats the rationale for why it was deemed OK to make the net461 asset target fallback a default.
@nguerrera currently, msbuild passes us a project tfm and a set of tfms to check compatibility and we return a bool indicating success or failure. We will need to work with @rrainersigwald to change that if needed.
@rrelyea had scenarios (wpf + uwp) where such P2P references make sense without the need for warnings.
You could log a warning from the task. We spent a lot of time talking about this for package refs and the warning was a big part of pulling the trigger on the AssetTargetFallback default. I don't see how it could be any different for projects, but I'm listening.
I would like this to be considered for 15.8 because I don't want to end up in a situation where we decide not to make a "breaking change" to add the warning that should always have been there.
I'm surprised to learn this actually works as I was under the impression that this will fail. We must at the very least issue a warning as @nguerrera suggests.
However, I believe our original design asked for this to be an error. The rationale being that the NuGet case is for references outside your control while P2Ps are expected to be under your control and we want to force developers to convert/modernize from the bottom up. However, I understand that making this an error now would be breaking change. But I don't think silent success here is acceptable behavior.
However, I understand that making this an error now would be breaking change.
This is new in 15.8 so technically hasn't shipped. I think there should be a way to do this with project references, I just don't think it should happen without any diagnostics.
This is new in 15.8 so technically hasn't shipped. I think there should be a way to do this with project references, I just don't think it should happen without any diagnostics.
That's fair. Not sure I wholeheartedly agree, but I could live with a warning, consistent with the NuGet experience. But silence is bad.
changed the title [-]No warning for AssetTargetFallback via P2P[/-][+]Using a projectreference which requires AssetTargetFallback to succeed, should warn.[/+]on Jan 25, 2019
changed the title [-]Using a projectreference which requires AssetTargetFallback to succeed, should warn.[/-][+]Using a ProjectReference which requires AssetTargetFallback to succeed, should warn.[/+]on Apr 3, 2019
Activity
mishra14 commentedon Jul 21, 2018
@nguerrera currently, msbuild passes us a project tfm and a set of tfms to check compatibility and we return a bool indicating success or failure. We will need to work with @rrainersigwald to change that if needed.
@rrelyea had scenarios (wpf + uwp) where such P2P references make sense without the need for warnings.
nguerrera commentedon Jul 21, 2018
You could log a warning from the task. We spent a lot of time talking about this for package refs and the warning was a big part of pulling the trigger on the AssetTargetFallback default. I don't see how it could be any different for projects, but I'm listening.
nguerrera commentedon Jul 21, 2018
I would like this to be considered for 15.8 because I don't want to end up in a situation where we decide not to make a "breaking change" to add the warning that should always have been there.
nguerrera commentedon Jul 21, 2018
cc @DamianEdwards
terrajobst commentedon Jul 21, 2018
I'm surprised to learn this actually works as I was under the impression that this will fail. We must at the very least issue a warning as @nguerrera suggests.
However, I believe our original design asked for this to be an error. The rationale being that the NuGet case is for references outside your control while P2Ps are expected to be under your control and we want to force developers to convert/modernize from the bottom up. However, I understand that making this an error now would be breaking change. But I don't think silent success here is acceptable behavior.
nguerrera commentedon Jul 21, 2018
This is new in 15.8 so technically hasn't shipped. I think there should be a way to do this with project references, I just don't think it should happen without any diagnostics.
terrajobst commentedon Jul 21, 2018
That's fair. Not sure I wholeheartedly agree, but I could live with a warning, consistent with the NuGet experience. But silence is bad.
mishra14 commentedon Jul 21, 2018
tagging @rrelyea for 4.8 visibility.
8 remaining items
rrelyea commentedon Jul 25, 2018
@mishra14 - please investigate this fix this morning.
Adding warning for P2P reference with ATF in GetReferenceNearestTarge…
rrelyea commentedon Jul 27, 2018
Currently checked into 16.0/5.0 (dev branch).
Will consider 15.9 as well, so moving to 15.9 for now, to consider.
[-]No warning for AssetTargetFallback via P2P[/-][+]Using a projectreference which requires AssetTargetFallback to succeed, should warn.[/+][-]Using a projectreference which requires AssetTargetFallback to succeed, should warn.[/-][+]Using a ProjectReference which requires AssetTargetFallback to succeed, should warn.[/+]