Visual Studio 2017 和新的 .csproj InternalsVisibleTo [英] Visual Studio 2017 and the new .csproj InternalsVisibleTo

查看:18
本文介绍了Visual Studio 2017 和新的 .csproj InternalsVisibleTo的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在新的 Visual Studio 2017 .csproj 项目文件中,我应该将 AssemblyInfo 中的 InternalsVisibleTo 放在哪里?

Where do I put InternalsVisibleTo from AssemblyInfo in the new Visual Studio 2017 .csproj project file?

推荐答案

为了澄清上面 Hans Passant 的评论,您只需将 InternalsVisibleTo 添加到项目中的任何 cs 文件中.例如,我在项目的根目录下创建了一个 AssemblyInfo.cs 文件,然后添加了以下内容(仅):

To clarify Hans Passant's comment above, you simply have to add InternalsVisibleTo to any cs file in your project. For example, I created an AssemblyInfo.cs file in the root of the project and then added the following content (only):

using System.Runtime.CompilerServices;

[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=<ADD_KEY_HERE>")]

这篇关于Visual Studio 2017 和新的 .csproj InternalsVisibleTo的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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