3

Is there any difference between these two using declarations ?

namespace myNamespace
{
    using System;
    using System.Collections.Generic;
    public class myClass
    {
    }
} 

AND

using System;
using System.Collections.Generic;
namespace myNamespace
{
   public class myClass
   {
   }
} 
2

1 Answer 1

0

The second one is considered "correct" and is a place where your colleagues would expect it to be. So even if there would be no differences (I don't know because I have never tried the first way), use the second one.

Sign up to request clarification or add additional context in comments.

1 Comment

Interestingly we're using version 1 at work and no one ever bothered. The official C# style guidelines also prefer version 2: msdn.microsoft.com/en-us/library/vstudio/w2a9a9s3.aspx - But I think as long as you're consistant it does not matter which you use.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.