-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Use .NET Standard facades without reference assembly bit set #1612
Conversation
<!-- netfx.force.conflicts is only needed at compile time. --> | ||
<Private Condition="'%(FileName)' == 'netfx.force.conflicts'">false</Private> | ||
<Reference Include="@(_NETStandardLibraryNETFrameworkLib.FileName)"> | ||
<HintPath>%(_NETStandardLibraryNETFrameworkLib.Identity)</HintPath> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why use the HintPath? Why not just <Reference Include="full path"
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also uses the simple name as the identity for the
Reference
items, and uses theHintPath
metadata for the full path. This should resolve at least some cases of #1499.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see it in your description now - for #1499.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I wonder if we want NuGet to do the same thing 🤔 I can't recall why the NuGet task originally used RawFileName given that was inconsistent with what the project system was doing, @jasonmalinowski might know.
Note, this will cause the same assemblies to be copied twice to the output folder in ASP.NET apps - once in the output folder and once under |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing up the test!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for getting this back in place so quickly.
|
||
<ReferenceCopyLocalPaths Include="@(_NETStandardLibraryNETFrameworkLib)"> | ||
<!-- netfx.force.conflicts is only needed at compile time. --> | ||
<ReferenceCopyLocalPaths Include="@(_NETStandardLibraryNETFrameworkLib)" Condition="'%(FileName)' != 'netfx.force.conflicts'"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be conditioned differently? Why didn't we need to know about netfx.force.conflicts here before, but now we do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see now. This is just porting what was there before the revert to the new scheme.
Even once that is fixed we can't break projects that haven't updated to the new package. We might be able to put a special case workaround in the deps.json generation code that would be based on what version of the DependencyModel library was in the graph (which you had suggested as a possible solution in IM). |
@MattGertz for approval (also we should discuss what release this should go in) Customer scenario .NET Framework projects targeting .NET Framework 4.6.1 or higher, and using a library that targets .NET Standard 1.5 or higher. A wide variety of tools will fail in this scenario, including debugging web projects (non ASP.NET Core), Workflow XAML projects, license generation (lc.exe / .licx), Sandcastle Help File Builder, and probably more. Bugs this fixes Related Issues: https://github.com/dotnet/corefx/issues/23229, #1522, https://github.com/dotnet/corefx/issues/23505, dotnet/corefx#23711 Workarounds, if any To all desktop project files add the following:
Risk Low Performance impact Improves performance by removing a number of items and wildcard expansion (further changes aim to improve more). Root cause analysis Web project system ignores CopyLocal metadata on references and will copy them to the output directory outside of the build if the file is absent. This breaks if any assembly is intentionally CopyLocal=false (AKA: Private=false), and a ReferenceAssembly without a corresponding implementation in the GAC. It will be copied to the output directory and later loaded for execution by ASP.NET. XAML compiler attempts to load all references for execution and fails for any that are ReferenceAssemblies without a corresponding implementation in the GAC. The previous fix to this bug (in #1582) broke Razor on ASP.NET Core on .NET Framework, due to a bug in the library Razor uses to read deps.json: dotnet/core-setup#2981 How was the bug found? Customer reports / Internal testing |
Approved for Preview 2. |
Please, re-target to release/15.5 |
…nging in .NET Standard facades
This reverts commit 3a58474.
7b1e5d8
to
e8ed8cf
Compare
@livarcocc Rebasing this onto release/15.5 also brought in the change from #1610. We do want this change, it just means that we haven't merged the latest version of release/2.0-vs into 15.5. Should we do that separately? |
@dsplaisted I think it is fine to do that together. They appear as separate commits anyways. My only concern is if git will know what to do when we merge this branch back. |
@dotnet-bot test this please |
…519.3 (#1612) [main] Update dependencies from dotnet/arcade
Bring back the fixes from #1582, which were reverted in #1610, this time without regressing ASP.NET Core apps on .NET Framework.
This does this by using only the "lib" and not the "ref" files from the .NET Standard facades, but putting each facade in two separate MSBuild items:
Reference
withPrivate
set to false, which means they won't be copied locally, andReferenceCopyLocalPaths
which will be copied locally. This will result in the deps.json file will have those items listed with typereferenceassembly
instead ofreference
, which means this won't run afoul of https://github.com/dotnet/core-setup/issues/2981.This also uses the simple name as the identity for the
Reference
items, and uses theHintPath
metadata for the full path. This should resolve at least some cases of #1499.