why cannot find enum in different file in C#?
<p>I have a C# file A which defined some public enum and public struct. Now I need to define errorCode for them. I defined an enum named SubsystemErrorCode in file B. Both A and B don't have class inside. They are in the same namespace In one struct of file A, I try to use the SubsystemErrorCode enum but it give me error tell me :
Error   1   The type or namespace name 'SubsystemErrorCode' could not be found (are you missing a using directive or an assembly reference?)    </p>

<p>If I move that SubsystemErrorCode into the same file. no error. But I really want them to be separated. How can I do this? thanks,</p>

<p>File A: </p>

<pre><code>namespace SystemSoftware { 
    public struct StatusMessageBody { 
        public ProcessControlStatus State; 
        public StatVal LVP_OK; 
        public SubsystemErrorCode LVP_ERROR_CODE; 
    } 
} 
</code></pre>

<p>File B: </p>

<pre><code>namespace SystemSoftware 
{ 
    //public class ErrorCode 
    //{ 
    public enum SubsystemErrorCode : byte 
    {
        NoError = 0, 
        EPCSS_CPU_ERROR = 1, 
        LVPS_ERROR 
    } 
    //} 
} 
</code></pre>
