question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

InternalsVisibleTo PublicKey does not respect variables in NET5 Preview SDK

See original GitHub issue

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?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

github_iconTop Results From Across the Web

InternalsVisibleTo attribute isn't working
In the External Tools dialog box, click Add and enter Get Assembly Public Key in the Title box. Fill the Command box by...
Read more >
InternalsVisibleToAttribute Class (System.Runtime. ...
Specifies that types that are ordinarily visible only within the current assembly are visible to a specified assembly.
Read more >
Version History - Documentation for GleamTech products
Fixed: In some cases, root folder quota was not respected, and chunks continued to be uploaded. A file that exceeds quota, will be...
Read more >
Declaring InternalsVisibleTo in the csproj
A convention is to declare assembly attribute in the file AssemblyInfo.cs. With the new SDK-based project, there is no AssemblyInfo.cs by ...
Read more >
C# 10 in a Nutshell
If any code samples or other technology this work contains or describes is subject to open source licenses or the intellectual property rights ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found