-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assets.json doesnot contains the project references for some of the platform specific older(< net5.0) frameworks #46338
Comments
Tagging subscribers to this area: @safern, @ViktorHofer Issue DetailsFor older frameworks we remove the os from tfm while running the restore, hence some of the project references under the targetsPlatform condition are not recogonized for those platforms. Hence they are not added in the project.assets.json file. cc @ViktorHofer @safern @ericstj
|
Our custom target framework platform shouldn't end in the generated packages anyway? As the NuGet won't add TargetPlatformMoniker support to .NETCoreApp < 5, I assume we won't be able to fix the described issue without being able to control the passed in dependencies per tfm? |
Thats correct it will be proxy for that is platformless one (the one in the assets file)
We can fix the issue by modifying our csprojs to use conditions which are true for netcoreapp2.0 and netcoreapp2.0-platform for just project references. |
Wouldn't that mean that these P2Ps wouldn't then be part of the project.assets.json file per project and hence these project wouldn't be restored? AFAIK the project.assets.json file is shared between restore and pack and can't be mutated just for packaging. |
Today they are not part of projects.assets.json, after fixing these, project references will be part of projects.assets.json |
Can you please elaborate on the current issue and how you are trying to fix it? Maybe you can also provide an example so that we know that we are talking about the same thing? |
This is system.diagnostics.eventlog <ItemGroup Condition="'$(TargetsWindows)' == 'true'">
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Win32.Registry\src\Microsoft.Win32.Registry.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)System.Threading.AccessControl\src\System.Threading.AccessControl.csproj" />
....
...
<ItemGroup Condition="!$(TargetFramework.StartsWith('net4'))">
<ProjectReference Include="$(LibrariesProjectRoot)System.Security.Principal.Windows\src\System.Security.Principal.Windows.csproj" />
</ItemGroup>
The project.assets.json file just contains this entry for netcoreapp2.0 "System.Security.Principal.Windows/6.0.0-dev": {
"type": "project",
"framework": ".NETStandard,Version=v2.0",
"compile": {
"bin/placeholder/System.Security.Principal.Windows.dll": {}
},
"runtime": {
"bin/placeholder/System.Security.Principal.Windows.dll": {}
}
},
It should contain similar entry for other 2 project references as well. does it makes sense ? i intend to fix it by adding <ItemGroup Condition="$(TargetFramework.StartsWith('netcoreapp2.0'))">
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Win32.Registry\src\Microsoft.Win32.Registry.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)System.Threading.AccessControl\src\System.Threading.AccessControl.csproj" />
</Itemgroup> |
Absolutely, thanks for clarifying. We discussed that when we enabled project restore and knew that we can't have P2Ps conditioned on the platform. I thought we even had a target that checked for that but apparently we never added one. How many cases of such pattern do we have? |
i didnt run the numbers, i will update when i do so. I will try to put up the pr for this by today. |
On second thought i will add with enabling the package csproj for these projects |
Do you already have a number of how many projects are affected? I think we should fix this anyway as it's an inconsistency in the restore graph. |
the number is around 9-10 but that was just a regex search. i am thinking if we could automate it or add a check for this. |
For older frameworks we remove the os from tfm while running the restore, hence some of the project references under the targetsPlatform condition are not recogonized for those platforms. Hence they are not added in the project.assets.json file.
We need to fix this as pack task uses the assets file to add the package dependencies.
cc @ViktorHofer @safern @ericstj
The text was updated successfully, but these errors were encountered: