2013-09-16 34 views
0

我有一個C#解決方案,包含Postsharp v3,Resharper 8,Redgate SqlBundle和.Net toolbet +一些非常大的T4模板生成的代碼。Postharder Resharper Redgate過度記錄

當從模板生成代碼並嘗試打開它們時,我的硬盤上的一個文件夾.. \ AppData \ Local \ Red Gate \ Logs \ SQL Connect 1 *每4或5秒填充50 MB日誌文件。所有的內容都非常相似。

14:49:01.331|Trace |g.TraceLoggerAdapter|1 |#1:devenv.exe Information: 0 : at at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo) 
    at System.Environment.get_StackTrace() 
    at RedGate.SQLConnect.VsPackage.Logging.TraceLoggerAdapter.WriteLine(String message) 
    at RedGate.SQLConnect.VsPackage.Logging.TraceLoggerAdapter.Write(String message) 
    at System.Diagnostics.TraceListener.WriteHeader(String source, TraceEventType eventType, Int32 id) 
    at System.Diagnostics.TraceListener.TraceEvent(TraceEventCache eventCache, String source, TraceEventType eventType, Int32 id, String format, Object[] args) 
    at System.Diagnostics.TraceInternal.TraceEvent(TraceEventType eventType, Int32 id, String format, Object[] args) 
    at PostSharp.VisualStudio.Services.Language.CodeParsingService.CodeElementVisitor.PostSharp.VisualStudio.Services.Language.ICodeElementVisitor.VisitCodeElement(String codeElementName, CodeElement codeElement, String semantic, ICodeLocator codeLocator) 
    at PostSharp.VisualStudio.Services.Language.CSharp.CSharpLanguageAdapter.VisitCodeProperty(CodeProperty codeProperty, String parentName, ICodeElementVisitor activator) 
    at PostSharp.VisualStudio.Services.Language.BaseLanguageAdapter.VisitCodeElement(CodeElement codeElement, String parentName, ICodeElementVisitor activator) 
    at PostSharp.VisualStudio.Services.Language.BaseLanguageAdapter.VisitCodeType(CodeType codeType, ICodeElementVisitor activator) 
    at PostSharp.VisualStudio.Services.Language.BaseLanguageAdapter.VisitCodeElement(CodeElement codeElement, String parentName, ICodeElementVisitor activator) 
    at PostSharp.VisualStudio.Services.Language.BaseLanguageAdapter.VisitCodeElement(CodeElement codeElement, String parentName, ICodeElementVisitor activator) 
    at PostSharp.VisualStudio.Services.Language.BaseLanguageAdapter.VisitCodeElement(CodeElement codeElement, ICodeElementVisitor visitor) 
    at PostSharp.VisualStudio.Services.Language.CodeParsingService.GetEnhancedCodeElements(FileCodeModel fileCodeModel) 
    at PostSharp.VisualStudio.View.Markers.TextMarkerLayer.ScanSnapshot(ITextSnapshot textSnapshot) 
    at PostSharp.VisualStudio.View.Markers.TextMarkerLayer.AddAdornments() 
    at PostSharp.VisualStudio.View.Markers.TextMarkerLayer.OnLayoutChangedDelayed(Object sender, EventArgs e) 
    at PostSharp.VisualStudio.View.QuietPeriodTimer.OnTick(Object sender, EventArgs e) 
    at System.Windows.Threading.DispatcherTimer.FireTick(Object unused) 
    at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) 
    at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) 
    at System.Windows.Threading.DispatcherOperation.InvokeImpl() 
    at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state) 
    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) 
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) 
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) 
    at System.Windows.Threading.DispatcherOperation.Invoke() 
    at System.Windows.Threading.Dispatcher.ProcessQueue() 
    at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) 
    at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) 
    at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) 
    at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) 
    at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) 
    at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) 
    at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) 
14:49:01.331|Trace |g.TraceLoggerAdapter|1 |#1:Scanning code element Petex.DP.Service.Requests.DpObject_GetDpObjectAllContainingRequest.RelatedToIDs of type vsCMElementProperty. at at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo) 
    at System.Environment.get_StackTrace() 
    at RedGate.SQLConnect.VsPackage.Logging.TraceLoggerAdapter.WriteLine(String message) 
    at System.Diagnostics.TraceListener.TraceEvent(TraceEventCache eventCache, String source, TraceEventType eventType, Int32 id, String format, Object[] args) 
    at System.Diagnostics.TraceInternal.TraceEvent(TraceEventType eventType, Int32 id, String format, Object[] args) 
    at PostSharp.VisualStudio.Services.Language.CodeParsingService.CodeElementVisitor.PostSharp.VisualStudio.Services.Language.ICodeElementVisitor.VisitCodeElement(String codeElementName, CodeElement codeElement, String semantic, ICodeLocator codeLocator) 
    at PostSharp.VisualStudio.Services.Language.CSharp.CSharpLanguageAdapter.VisitCodeProperty(CodeProperty codeProperty, String parentName, ICodeElementVisitor activator) 
    at PostSharp.VisualStudio.Services.Language.BaseLanguageAdapter.VisitCodeElement(CodeElement codeElement, String parentName, ICodeElementVisitor activator) 
    at PostSharp.VisualStudio.Services.Language.BaseLanguageAdapter.VisitCodeType(CodeType codeType, ICodeElementVisitor activator) 
    at PostSharp.VisualStudio.Services.Language.BaseLanguageAdapter.VisitCodeElement(CodeElement codeElement, String parentName, ICodeElementVisitor activator) 
    at PostSharp.VisualStudio.Services.Language.BaseLanguageAdapter.VisitCodeElement(CodeElement codeElement, String parentName, ICodeElementVisitor activator) 
    at PostSharp.VisualStudio.Services.Language.BaseLanguageAdapter.VisitCodeElement(CodeElement codeElement, ICodeElementVisitor visitor) 
    at PostSharp.VisualStudio.Services.Language.CodeParsingService.GetEnhancedCodeElements(FileCodeModel fileCodeModel) 
    at PostSharp.VisualStudio.View.Markers.TextMarkerLayer.ScanSnapshot(ITextSnapshot textSnapshot) 
    at PostSharp.VisualStudio.View.Markers.TextMarkerLayer.AddAdornments() 
    at PostSharp.VisualStudio.View.Markers.TextMarkerLayer.OnLayoutChangedDelayed(Object sender, EventArgs e) 
    at PostSharp.VisualStudio.View.QuietPeriodTimer.OnTick(Object sender, EventArgs e) 
    at System.Windows.Threading.DispatcherTimer.FireTick(Object unused) 
    at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) 
    at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) 
    at System.Windows.Threading.DispatcherOperation.InvokeImpl() 
    at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state) 
    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) 
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) 
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) 
    at System.Windows.Threading.DispatcherOperation.Invoke() 
    at System.Windows.Threading.Dispatcher.ProcessQueue() 
    at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) 
    at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) 
    at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) 
    at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) 
    at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) 
    at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) 
    at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) 

任何想法如何阻止它作爲其破壞我的開發環境?

回答

0

這是由PostSharp和Redgate行爲的組合引起的。

PostSharp會定期生成跟蹤消息,並且它們不會正常寫入任何文件。只有在高級PostSharp選項中啓用診斷窗口,才能看到消息。

另一方面,Redgate會安裝跟蹤偵聽器來捕獲包括由PostSharp生成的消息並將它們寫入日誌文件的消息,最重要的是它似乎爲每條消息添加了堆棧跟蹤(即使它不是一個例外)。這是一個不幸的因素組合。至於PostSharp,除非用戶明確地啓用了診斷窗口,否則會有一個修復計劃完全禁用跟蹤。

+0

任何想法如何關閉Postharp跟蹤? – Jimbo