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

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

问题描述

.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.

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

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