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.

[Enhancement] Strong Name assemblies

See original GitHub issue

Summary

Consider strong naming Microsoft.Maui.* and including the snk in the repo.

I understand this wasn’t an option on Xamarin but would this be an option on MAUI?

After all, this is the official library authoring guideline from .NET:

✔️ CONSIDER strong naming your library’s assemblies.

✔️ CONSIDER adding the strong naming key to your source control system.

CSC : error CS8002: Referenced assembly 'Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' does not have a strong name.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:5
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mattjohnsonpintcommented, Nov 17, 2022

I believe I have found a reasonable workaround:

<PropertyGroup>
  <NoWarn>$(NoWarn);CS8002</NoWarn>
  <SignAssembly>true</SignAssembly>
  <UseMaui>true</UseMaui>
</PropertyGroup>

That allows signed projects to consume unsigned MAUI assemblies. Everything then just works as expected.

1reaction
mattjohnsonpintcommented, May 18, 2022

Here’s another case for strong naming the MAUI assemblies.

If a MAUI project references a .NET class library that is strong named, the class library won’t be able to use InternalsVisibleTo to make its internals available to the MAUI project. Trying to do so will give a compile error:

[CS1726] Friend assembly reference 'MyMauiAssembly' is invalid. Strong-name signed assemblies must
         specify a public key in their InternalsVisibleTo declarations.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Enhanced strong naming
Strong name keys consist of a signature key and an identity key. The assembly is signed with the signature key and is identified...
Read more >
Create and use strong-named assemblies
A strong name consists of the assembly's identity—its simple text name, version number, and culture information (if provided)—plus a public ...
Read more >
Enhanced Strong Naming
I am testing Enhanced Strong Naming (http://msdn.microsoft.com/en-us/library/hh415055.aspx) and having some problems getting it into a build ...
Read more >
Strong-named assemblies
A strong name consists of an assembly's identity—its simple text name, version number, and culture information (when provided)—plus a public key and digital ......
Read more >
Assigning a strong name key - SmartAssembly 6
Signing your assembly with a strong name key protects the assembly's name, and prevents modification of the assembly. To use strong name key ......
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