project.json 相当于 InternalsVisibleTo [英] project.json Equivalent of InternalsVisibleTo

查看:27
本文介绍了project.json 相当于 InternalsVisibleTo的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

.Net Core 的 project.json 允许配置传统 .Net 应用程序使用通常放置在 AssemblyInfo.cs 中的属性(例如 AssemblyTitle, AssemblyCopyright, AssemblyVersion).但是,我还没有弄清楚如何在 project.json 中设置的一个程序集属性是 InternalsVisibleTo.

.Net Core's project.json allows configuration of various assembly properties (e.g. title, version, copyright) that a traditional .Net application would define using attributes typically placed in AssemblyInfo.cs (e.g. AssemblyTitle, AssemblyCopyright, AssemblyVersion). However, one assembly property I haven't figured out how to set in project.json is InternalsVisibleTo.

有没有办法使用 project.json 来指示另一个程序集应该对当前项目具有内部可见性?

Is there a way to use project.json to indicate that another assembly should have internal visibility into the current project?

推荐答案

不 - 只需像往常一样将其放在 AssemblyInfo.cs 中.这仍然是放置程序集属性的完美位置.如果在您使用的模板中没有为您创建,只需创建您自己的 AssemblyInfo.cs 文件(当然,或任何其他名称).基本上,您可以将程序集属性放在任何您想要的位置.

No - just put it in AssemblyInfo.cs as normal. That's still a perfectly fine place to put assembly attributes. If one isn't created for you in the template you're using, just create your own AssemblyInfo.cs file (or any other name, of course). You can put the assembly attributes wherever you want, basically.

这篇关于project.json 相当于 InternalsVisibleTo的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆