/ Published in: VB.NET
                    
                                        
VS.NET Macro to list all projects in current solution that have TreatWarningsAsErrors=false.
                
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
Sub ScanProjectsForTreatWarningsAsErrors()
Const PaneName As String = "TreatWarningsAsErrors"
Dim ow As OutputWindow = DTE.ToolWindows.OutputWindow
Dim owp As OutputWindowPane = ow.OutputWindowPanes.Item(PaneName)
If owp Is Nothing Then
owp = ow.OutputWindowPanes.Add(PaneName)
End If
owp.Clear()
owp.Activate()
For Each project As Project In DTE.Solution.Projects
ScanProject(project, owp)
Exit For
Next
End Sub
Sub ScanProject(ByVal project As Project, ByVal owp As OutputWindowPane)
If (project.Kind = "{66A26720-8FB5-11D2-AA7E-00C04F688DDE}") Then
For Each projectItem As ProjectItem In project.ProjectItems
If Not (projectItem.SubProject Is Nothing) Then
ScanProject(projectItem.SubProject, owp)
End If
Next
Else
For Each config As Configuration In project.ConfigurationManager
Dim value As Boolean = CType(config.Properties.Item("TreatWarningsAsErrors").Value, Boolean)
If Not value Then
owp.OutputString("Project: " + project.Name + ", " + config.ConfigurationName)
owp.OutputString(" - TreatWarningsAsErrors = " + value.ToString())
owp.OutputString(vbCrLf)
End If
Next
'For Each configProp As [Property] In project.ConfigurationManager.Item(1).Properties
' owp.OutputString(configProp.Name + vbCrLf)
'Next
End If
End Sub
URL: http://www.onlinescorekeeper.com/
Comments
 Subscribe to comments
                    Subscribe to comments
                
                