3

When Visual Studio 2010 generates code (example: select option to implement an interface), it generates "string" instead of "String", even if I have defined the interface with "String" parameters.

Is there a way to get VS2010 to always generate "String". My preference is to use the .NET type names, not the C# aliases for the types.

3
  • 1
    I also have looked for this feature, neither VS2010 and resharper contain this feature... Commented May 5, 2011 at 10:09
  • 1
    Just curious :-) I means you also use only "Object", "Int32", "Single", etc...? Commented May 5, 2011 at 10:16
  • 1
    You are Jeff Atwood's favorite blog topic. codinghorror.com/blog/2007/06/… Commented May 5, 2011 at 13:03

2 Answers 2

2

string is an alias of String so technically there is no difference between the two.

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

1 Comment

I'm sure the OP is aware of that. I think the question is about style ("Use .net typenames, not aliases") and how to make VS generated code conform to your style guide.
0

From the MSDN info about string "The string type represents a sequence of zero or more Unicode characters. string is an alias for String in the .NET Framework." So it's the same String and string.

See you

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.