Skip to content

InternalsVisibleTo PublicKey does not respect variables in NET5 Preview SDK #13289

@JimBobSquarePants

Description

@JimBobSquarePants

I'm hoping this is the right place, please let me know If I shouldraise the issue elsewhere.

For SDK versions prior to .NET 5 previews it is possible to declare InternalsVisibleTo values in a Directory.Build.props file in subfolders using the following approach.

<InternalsVisibleTo Include="SixLabors.ImageSharp.Web.Tests"  PublicKey="$(SixLaborsPublicKey)" />

Where the variable had been declared in a root Directory.Build.props file.

<SixLaborsPublicKey> KEY HERE </SixLaborsPublicKey>

When attempting to build a solution via dotnet build with any .NET 5 preview SDK installed the folllowing error occurs.

error CS1726: Friend assembly reference 'SixLabors.ImageSharp.Web.Tests' is invalid. Strong-name signed assemblies must specify a public key in their InternalsVisibleTo declarations.

What has changed which breaks current behavior and what (other than disabling the preview via global.json) is the correct workaround?

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