我试图让VS将下列警告视为错误。我没有取得任何成功,既没有具体的警告,也没有任何警告(在项目选项中)。将警告视为错误
输出
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1490,5): warning MSB3247: Found conflicts between different versions of the same dependent assembly.
错误列表
Warning 1 Found conflicts between different versions of the same dependent assembly.
我试图解决的问题是这样的:MyApp的引用力霸V1和V1 LibB。 LibB v1引用了LibA v2。起初没有关于版本差异的通知。签署组件会给出警告。如果可能的话,我想把它看成是一个错误,因为这些会比注意到的警告快得多。
更新 在与菲尔的答案工作后,我现在使用这个宏。可能为此做一个插件,但我现在没有时间这样做。
Private Sub BuildEvents_OnBuildDone(ByVal Scope As EnvDTE.vsBuildScope, ByVal Action As EnvDTE.vsBuildAction) Handles BuildEvents.OnBuildDone
' Create a tool window handle for the Output window.
Dim win As Window = DTE.Windows.Item(EnvDTE.Constants.vsWindowKindOutput)
' Create handles to the Output window and its panes.
Dim OW As OutputWindow = win.Object
OW.ActivePane.TextDocument.Selection.SelectAll()
If OW.ActivePane.TextDocument.Selection.Text.Contains("MSB3247") Then
System.Windows.Forms.MessageBox.Show("Found conflicts between different versions of the same dependent assembly.", "warning MSB3247")
End If
End Sub
VS的什么版本? – Connell
我试图在VS2010中,但我也使用VS2008的WinCE项目。 – Stijn