Update to assembly filtering in ClickOnce task for .NET Core scenario #6080
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
Issue:
ClickOnce filters our assemblies that are part of the .NET Framework from publishing. This is done by looking up the assembly reference in C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework<version> folder. This works reliably for .NET FX scenarios. However for .NET Core, this check is not reliable. For a packages like System.ServiceModel.Primitives, the system.servicemodel and system.servicemodel.primitives assemblies get filtered out because they are present under C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETCore but they are not present in .NET Core's runtime pack.
This will lead to app launch failure due to missing dependency.
Changes Made
Fix ClickOnce's assembly filtering code for .net core to not filter copylocal assemblies even if the look up under C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETCore has succeeded.
Testing
CTI has validated specific packages that are affected and also validated the change against top 50 NuGet packages.
Work Item
https://developercommunity2.visualstudio.com/t/ClickOnce-no-longer-works/1288425