在外部引用和存储强名称以供重用
I have a lot of assemblies that have set the InternalsVisibleToAttribute pointing one specifc assembly within the same solution. Unfortunately the assembly that is being pointed to has a stong name, so I always have to put the same public key token over and over again into the AssemblyInfo.cs files. Since there is no precompiler in c#, how would I ideally eliminate this redundancy.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您有几个简单的选项:
#1 管理起来稍微简单一些,但它有一个不幸的副作用 删除对引用项目中引用的内部结构的 IntelliSense 支持。
#2 管理起来有些复杂,但它不会干扰 IntelliSense 支持。
You have a couple of easy-ish options:
#1 is somewhat simpler to manage, but it has the unfortunate side-effect of removing IntelliSense support for the referenced internals in the referencing project.
#2 is somewhat more complex to manage, but it doesn't interfere with IntelliSense support.
也许你可以使用 t4
将
AssemblyInfo.cs
重命名为AssemblyInfo.tt
并添加类似的内容
maybe you could use t4
rename
AssemblyInfo.cs
toAssemblyInfo.tt
and add something like this