Repository navigation
Add proposal for supporting Reference items to assemblies in .NET Core targeting packs - #81
dsplaisted wants to merge 1 commit into
Conversation
…e targeting packs
|
|
||
| WPF has several different theme assemblies, such as PresentationFramework.Aero and PresentationFramework.Luna. Each of these theme assemblies has types with the same name and namespace. This means that if you reference more than one of these assemblies, you need to do so with an assembly alias in order to distinguish between the types from the different assemblies in code. | ||
|
|
||
| With this proposal, we would not reference any of the theme assemblies by default. To use a single theme assembly, you would add a reference to it: |
There was a problem hiding this comment.
Not referencing any of the theme assemblies is already the default - right? I would expect that with this proposal, the theme assemblies would become accessible.
If the change to remove theme assemblies from all profiles hasn't yet been made, then the current default is that all theme assemblies are referenced, and none are usable.
There was a problem hiding this comment.
We have not yet removed the theme assemblies from being referenced by default.
|
|
||
| ### Conflict Resolution | ||
|
|
||
| Conflict resolution runs before ResolveAssemblyReference, however there may be conflicts involving references that will be resolved from a targeting pack by ResolveAssemblyReference. If there is a simple name reference to an assembly which is in multiple targeting packs, then ResolveAssemblyReference needs to pick the best one (using similar logic to conflict resolution). If there is a conflict between a simple name which will be resolved by ResolveAssemblyReference and another reference (either from a NuGet package or that has been resolved from a targeting pack already by ResolveTargetingPackAssets), then ResolvePackageFileConflicts needs to resolve the conflict. It already does something similar for .NET Framework, by reading the FrameworkList to get the version information that a reference will resolve to. |
There was a problem hiding this comment.
Will conflict resolution handle ProjectReference vs. another reference correctly?
There was a problem hiding this comment.
Do you mean if you're referencing a project that produces the same assembly that's in a targeting pack? If so, I wouldn't guarantee that conflict resolution will correctly handle that by default, as that should only happen for projects that are included in the targeting pack, which may have to add special case logic for this.
There was a problem hiding this comment.
Yes, that's exactly what I mean. Microsoft.NetCore.App contains WindowsBase.dll, and if WPF repo tries to build PresentationFramework.csproj with a reference to WindowsBase.csproj, and a FrameworkReference to Microsoft.NetCore.App, will conflict resolution ensure that WindowsBase.csproj wins (alongwith the correct results in deps.json etc.)?
If that's not the case (I'm reasonably certain this doesn't work today - we have had to work aroudn this in WPF repos), can this scenario be fixed in conflict-resolution as part of this work?
|
fyi @merriemcgaw, @zsd4yr, @AdamYoblick |
|
|
||
| ```xml | ||
| <FrameworkReference Update="Microsoft.WindowsDesktop.App" IncludeReferences="False" /> | ||
| <Reference Include="System.Printing" /> |
There was a problem hiding this comment.
Can we also use it like this?
<FrameworkReference Include="Microsoft.WindowsDesktop.App" />
<Reference Exclude="System.Printing">OR
<FrameworkReference Include="Microsoft.WindowsDesktop.App" />
<Reference Remove="System.Printing">|
@dsplaisted should this be merged or closed? |
|
We ended up not needing this so we don't plan to do it at this time. |
This proposal is based on the discussion and proposed solution w.r.t. the WPF theme assemblies from here: dotnet/sdk#3265