how can i access internals in asp.net 5

偶尔善良 提交于 2019-12-05 01:03:46

You can add your own AssemblyInfo.cs file. Just add a class file, name it AssemblyInfo.cs (or any name for that matter), and replace all of its code with the following line:

[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("some.assembly.name")]

You can see an example of the above answer in action in the asp open sourced MVC project available on github:

https://github.com/aspnet/Mvc/blob/e2fd41e416ce1d84e13734ebfb56e64094607d01/src/Microsoft.AspNetCore.Mvc.Abstractions/Properties/AssemblyInfo.cs

One of the best ways of figuring this stuff out is to get in there and have a dig about.

Good luck.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!