c# - When I type static, Visual Studio replaces it with ContextStaticAttribute -


every time i'd put in static keep replacing contextstaticattribute.

i need 10 rep post images, here's link: http://i.imgur.com/jboof3s.png)

i not want have press right arrow put in local variable!

i figured out how did typing static inside method.

variables in method cannot static, class level elements can.

simply declare variables inside class, not method.

example:

namespace consoleapplication2 {     class program     {         static string username; // correct          private static void main()         {             static // incorrect         }     } } 

Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -