【问题标题】:Is it possible to embed a resource with an accessibility modifier different than the default public?是否可以嵌入具有不同于默认公共的可访问性修饰符的资源?
【发布时间】:2020-08-11 22:57:28
【问题描述】:

默认情况下,嵌入式资源设置为public可访问性修饰符。

当我查看带有令牌嵌入资源的示例程序时,ILSpy 这么说。

我发现下面的这个页面声称可以将它们设置为private,但不清楚如何通过VS2019 或手动编辑csproj 文件来实现这一点。

https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/resource-compiler-option

感谢任何线索。

【问题讨论】:

    标签: c# .net visual-studio embedded-resource access-modifiers


    【解决方案1】:

    csproj 架构似乎不支持此设置。架构文件的路径是

    c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Xml\Schemas\1033\MSBuild\Microsoft.Build.Core.xsd

    c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Xml\Schemas\1033\MSBuild\Microsoft.Build.Commontypes.xsd

    csproj 文件实际上是 MSBuild 文件。

    【讨论】:

    • 感谢您的努力,即使它不是答案。我一直在寻找那些,但找不到它们。谢谢。对你有好报。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-01-04
    • 2014-03-06
    • 2016-06-08
    • 1970-01-01
    • 2011-01-31
    • 2023-03-10
    • 2020-11-30
    相关资源
    最近更新 更多