VS2005 web bug

Problem

Static members don't seem to be recognised unless you fully qualify the class name. For example, this code causes a compilation error to the effect that ByScale cannot be resolved as a member of Map:

imgUrl = Map.ByScale[scale].Projection.GetTilename(position);

This, on the other hand, compiles without incident:

imgUrl = GPSO.Mapping.Map.ByScale[scale].Projection.GetTilename(position);

To confuse matters further, this doesn't happen when you first import the assembly; if you write the code and import the assembly in the same session it compiles without incident. 

Solution

Fully qualify class names when referencing static methods in ASP.

Published 02-25-2008 9:15 by peterw
Filed under: ,