C# specification (section 26.1) reads:
[`var is] an implicitly typed local variable declaration ...
It goes further:
A local variable declarator in an implicitly typed local variable
declaration is subject to the following restrictions:
- The declarator must include an initializer.
- The initializer must be an expression.
- The initializer expression must have a compile-time type which cannot
be the null type.
- The local variable declaration cannot include
multiple declarators.
- The initializer cannot refer to the declared variable itself
So no, you cannot do this. Moreover I would recommend steering away from even thinking about global variables.
Global variables are not supported by the language. You may find alternatives in public static
fields, but this will leak object state and break encapsulation.