共用方式為


編譯器錯誤 CS1529

更新:2007 年 11 月

錯誤訊息

using 子句必須位於定義在命名空間中所有其他項目的前面 (外部別名宣告除外)

using 子句必須最先出現在命名空間中。

範例

下列範例會產生 CS1529:

// CS1529.cs
namespace X
{
    namespace Subspace
    {
        using Microsoft;

        class SomeClass
        {
        };

        using Microsoft;      // CS1529, place before class definition
    }

    using System.Reflection;  // CS1529, place before namespace 'Subspace'
}

using System;                 // CS1529, place at the beginning of the file