0
需要從現成的(和工作)自定義屬性繼承修改Log4PostSharp項目。它看起來類似於這樣:Log4PostSharp項目屬性
[AttributeUsage(
AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Module | AttributeTargets.Struct,
AllowMultiple = true,
Inherited = false)]
[MulticastAttributeUsage(
MulticastTargets.InstanceConstructor | MulticastTargets.StaticConstructor | MulticastTargets.Method,
AllowMultiple = true)]
#if SILVERLIGHT
[RequirePostSharp("Log4PostSharp", "Log4PostSharp.Weaver.SilverlightLogTask")]
#else
[RequirePostSharp("Log4PostSharp", "Log4PostSharp.Weaver.LogTask")]
[Serializable]
#endif
public sealed class LogWithExceptionAttribute : LogAttribute
{
public LogWithExceptionAttribute()
{
ExceptionLevel = LogLevel.Error;
}
...
}
這是怎麼了,我選擇了一些註釋單元測試代碼:
[LogWithException]
private void DoThrowException()
{
throw new Exception("test exception");
}
想嘗試調試編譯時的過程,試圖從編譯命令行卻無法得到任何提示:
> msbuild Log4PostSharp.Test.csproj /p:PostSharpBuild=Diag /p:PostSharpTrace="AssemblyBinding;Project" /v:detailed
哪一種解決問題的正確方法是?我正在嘗試做什麼錯事?