project.json Equivalent of InternalsVisibleTo

Ben Gribaudo picture Ben Gribaudo · Oct 27, 2016 · Viewed 7.1k times · Source

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

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

Answer

Jon Skeet picture Jon Skeet · Oct 27, 2016

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.