百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
S

strongnamer

> 编程语言
开源

在 .NET 中的大多数应用程序都不需要强名字 [1]。强名字也会带来麻烦,因为它们最终需要在运行时进行验证。

338 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

在 .NET 中的大多数应用程序都不需要强名字 [1]。强名字也会带来麻烦,因为它们最终需要在运行时进行验证。

Strong Namer

Most applications in .NET do not need to be strong named. Strong names can also introduce pain because they end up requiring binding redirects. Because of this, many OSS libraries do not strong name their assemblies.

Strong named assemblies that reference assemblies that aren't strong named are rejected by the .NET Framework (desktop app only restriction). So if for whatever reason you actually do need to strong name your project, you couldn't easily consume open source packages.

Strong Namer is a NuGet package which aims to change this. Simply install the StrongNamer NuGet package, and it will transparently and automatically sign the assemblies you reference as part of the build process.

Demo

Here's how to try Strong Namer out for yourself:

  • Create a new Console application
  • Add a strong name to the application
    • Go to the Signing tab of the project properties
    • Check "Sign the assembly"
    • In the key file dropdown, choose <New...>
    • Choose a key file name (ie "key.snk"), uncheck the password option, and click OK
  • Add a reference to the Octokit NuGet package
  • Replace Program class with the following code:
…
  • Start without debugging (CTRL+F5)

  • :disappointed:

  • Add a reference to the StrongNamer NuGet package

  • Start without debugging (CTRL+F5)

  • :sparkles: :fireworks: :smile: :fireworks: :sparkles:

How does it work?

The NuGet package includes an MSBuild targets file and task which hook into the build process and add a strong name to any references which aren't strong named just before they are passed to the compiler.

The task uses Mono.Cecil to do this. Credit goes to Nivot.StrongNaming for showing me how to do this.

Options

You can conditionally disable automated signing of unsigned packages by setting the "DisableStrongNamer" property to "true". This is particularly useful if you have a custom build configuration for your application (e.g., you only wish for unsigned packages to be autosigned in specific environments).

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C#

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言