Skip to content

Update AppWithPlugin sample to correctly specify non-private project references #1760

Closed

Description

@vitek-karas

Issue description

The AppWithPlugin sample uses this for non-private project references:

<ProjectReference Include="PluginBase">
  <Private>false</Private>
</ProjectReference>

This works for the sample itself, but it doesn't always correctly translate for more complex projects. Specifically if PluginBase would have a PackageReference, the "Private=false" doesn't correctly propagate over to the PackageReference and the output contains "traces" of the NuGet package (in the .deps.json). This can cause issues when loading plugins.

The workaround seems to be to include "ExcludeAssets=runtime" as well, so the project reference would look like this:

<ProjectReference Include="PluginBase">
  <Private>false</Private>
  <ExcludeAssets>runtime</ExcludeAssets>
</ProjectReference>

The exact workaround needs to be validated with the product team (@nguerrera).
Even though this is not necessary for the sample in question, fixing it here will make people using the sample more likely to a working state at first try.

We're still trying to figure out if this is an actual product bug or if this is a desired behavior. Either way for .NET Core 3.0 this is how it works, and so fixing the sample is preferable.

Target framework

.NET Core 3.0

Activity

  1. vitek-karas commented on Nov 11, 2019

    @vitek-karas
    MemberAuthor

    The change to the accompanying guide is tracked here: dotnet/docs#15811

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions