<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                # /moduleassemblyname (C# Compiler Option) 指定一個程序集,其非公共類型可由 netmodule 訪問。 ## 語法 ``` /moduleassemblyname:assembly_name ``` ## 參數 _assembly_name_ 程序集的名稱,.netmodule 可以訪問該程序集的非公共類型。 ## 備注 應使用**/moduleassemblyname**,當生成 .netmodule,且滿足以下條件的位置: * netmodule 需要具有訪問現有程序集中非公共類型的權限。 * 知道 .netmodule 將生成的程序集的名稱。 * 現存的程序集已經被授予.netmodule 將生成到的程序集友元程序集訪問權限。 有關建立.netmodule 的更多信息,請參見 [/target:module (C# Compiler Options)](https://msdn.microsoft.com/zh-cn/library/58scf68s.aspx)。 有關友元程序集的更多信息,請參見 [友元程序集(C# 和 Visual Basic)](https://msdn.microsoft.com/zh-cn/library/0tke9fxk.aspx)。 此選項在開發環境中不可用;它僅在從命令行編譯時才可用。 此編譯器選項在 Visual Studio 中不可用,且不能通過編程方式進行更改。 此示例生成具有私有類型的程序集,并且該程序集授予稱為 csman_an_assembly 的程序集友元程序集訪問權限。 ``` // moduleassemblyname_1.cs // compile with: /target:library using System; using System.Runtime.CompilerServices; [assembly:InternalsVisibleTo ("csman_an_assembly")] class An_Internal_Class { public void Test() { Console.WriteLine("An_Internal_Class.Test called"); } } ``` 該例建立一個可訪問程序集 moduleassemblyname_1.dll 中非公共類型的.netmodule。通過了解此 .netmodule 將生成到調用 csman_an_assembly的程序集,可以指定 **/moduleassemblyname**,允許 .netmodule 在已經別授予csman_an_assembly的友元程序集訪問權限的程序集中訪問非公共類型。 ``` // moduleassemblyname_2.cs // compile with: /moduleassemblyname:csman_an_assembly /target:module /reference:moduleassemblyname_1.dll class B { public void Test() { An_Internal_Class x = new An_Internal_Class(); x.Test(); } } ``` 此代碼示例通過引用以前生成的程序集和 .netmodule ,生成程序集 csman_an_assembly。 ``` // csman_an_assembly.cs // compile with: /addmodule:moduleassemblyname_2.netmodule /reference:moduleassemblyname_1.dll class A { public static void Main() { B bb = new B(); bb.Test(); } } ``` ``` 已調用 An_Internal_Class.Test ``` ## 請參閱 [C# Compiler Options](https://msdn.microsoft.com/zh-cn/library/2fdbz5xd.aspx) [如何:修改項目屬性和配置設置](https://msdn.microsoft.com/zh-cn/library/z15yzzew.aspx)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看