Property Line numbers are not correct

Property Line numbers are not correct

It appears that the line number being saved in the coverage report is the first line that contains code and not the get or set line.

So for the following property: if (Environment == EnvironmentType.Sandbox) is the line number being stored and not get {

/// <summary>
/// The Current Merchant ID
/// </summary>
public virtual long MerchantID {
  get {
    if (Environment == EnvironmentType.Sandbox)
      return _sandboxMerchantID;
    else if (Environment == EnvironmentType.Production)
      return _productionMerchantID;
    else {
      throw new ConfigurationException("Environment Must be set.");   
    }
  }
}

What this also seems to affect is if you click on the property declaration and not the get or set in NCover Explorer. Since the Line number that the actual property is defined on is not stored (public virtual long MerchantID {), when you click on the property in NCover explorer, it goes to the getter or setter (whichever is first), causing an alignment issue (you can't see the declaration). In the above example, NCover Explorer is off by 3 lines when you click on MerchantID in the Explorer.

If you need any additional information, feel free to contact me.

Joe Feser


RE: Property Line numbers are not correct

Joe Feser,

Thank you for your feedback. This is a known issue that arises from the way method line numbers are stored in the pdbs. We are currently considering several solutions to the problem to figure out what the best one is.

Stephen Ward