Postsharp - App Settings configuration check
<p>I've created a PostSharp aspect to throw compilation error when key in app.config file not exists, but ConfigurationManager.AppSettings.HasKeys() returns "false" when i check it in CompileTimeValidate method. Can help me? Thanks!</p>

<pre><code>[Serializable]
public class ConfigurationValueRequiredAttribute : MethodInterceptionAspect
{
    // Method invoked at build time. It validates that the aspect has been applied to an acceptable method.
    public override bool CompileTimeValidate(MethodBase method)
    {
        bool valid = true;

        if (string.IsNullOrEmpty(ConfigurationManager.AppSettings["Test"]))
        {

            Message.Write(SeverityType.Error, "CUSTOM02", "Test not exists!");
            valid = false;
        }

        return valid;
    }
}
</code></pre>