Repository navigation
Adding warning for P2P reference with ATF in GetReferenceNearestTargetFrameworkTask - #2366
Conversation
|
cc @rrelyea |
|
As discussed, need to enable this for restore inside |
nkolev92
left a comment
There was a problem hiding this comment.
Looks fine in general.
Verify the VS experience etc.
There was a problem hiding this comment.
Declare it in the out statement?
|
@jainaashish I discussed this with @rainersigwald and |
8cf3bb6 to
d2d6f51
Compare
| <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | ||
| </resheader> | ||
| <data name="ImportsFallbackWarning" xml:space="preserve"> | ||
| <value>Project '{0}' was restored using '{1}' instead of the project target framework '{2}'. This project may not be fully compatible with your project.</value> |
There was a problem hiding this comment.
nit: not too clear about the warning message for couple of reasons:
- This is raised as part of build, not restore so may be more appropriate to use
resolveinstead ofrestore. - Host project should also be mentioned otherwise it will be pain to relate it in command line.
May be something like
Project {0} P2P reference {1} resolved using {2} instead of the project target framework {3}. This.......... {0} - Host Project {1} - P2P reference {2} - fallback tfm {3} - original project tfm
There was a problem hiding this comment.
Or
Project '{0}' is referenced using target framework '{1}' instead of this project's target framework '{2}'. This project may not be fully compatible with your project.
?
| warning.ProjectPath = CurrentProjectName; | ||
|
|
||
| // log NU1702 for ATF on project reference | ||
| logger.Log(warning); |
There was a problem hiding this comment.
Just to understand how are we skipping this warning when customer has no warn this? or will it be MSBuild who will take care of that?
There was a problem hiding this comment.
As long as this code is unique to this situation, MSBuild now has a general-purpose property MSBuildWarningsAsMessages that can suppress messages by code.
There was a problem hiding this comment.
msbuild now has support for thhis - dotnet/msbuild#1928
<MSBuildWarningsAsMessages>NU1702</MSBuildWarningsAsMessages>
jainaashish
left a comment
There was a problem hiding this comment.
Overall looks good, just a small suggestion to improve warning message. Current message seemed lil confusing.
Bug
Fixes: NuGet/Home#7137
Regression: No
Fix
Details: As part of #1983 we enabled msbuild to check fallback frameworks while checking compatibility between 2 projects. However,
AssetTargetFallbackbased compatibility in packages logs warning. This PR adds a warning inGetReferenceNearestTargetFrameworkTaskwhich is called on build time by msbuild.Testing/Validation
Tests Added: Yes
Validation done: manual commandline