Visual Studio macro: Find files that aren’t included in the project?

Here is the C# version of your code: public static void IncludeNewFiles() { int count = 0; EnvDTE80.DTE2 dte2; List<string> newfiles; dte2 = (EnvDTE80.DTE2)System.Runtime.InteropServices.Marshal.GetActiveObject(“VisualStudio.DTE.10.0”); foreach (Project project in dte2.Solution.Projects) { if (project.UniqueName.EndsWith(“.csproj”)) { newfiles = GetFilesNotInProject(project); foreach (var file in newfiles) project.ProjectItems.AddFromFile(file); count += newfiles.Count; } } dte2.StatusBar.Text = String.Format(“{0} new file{1} included in the … Read more

Toggle “Break when an exception is thrown.” using macro or keyboard shortcut

Very similar to the other answer, but there is a special ExceptionSetting for the group. Dim dbg As EnvDTE90.Debugger3 = DTE.Debugger Dim exSettings As EnvDTE90.ExceptionSettings = dbg.ExceptionGroups.Item(“Common Language Runtime Exceptions”) Dim exSetting As EnvDTE90.ExceptionSetting Try exSetting = exSettings.Item(“Common Language Runtime Exceptions”) Catch ex As COMException If ex.ErrorCode = -2147352565 Then exSetting = exSettings.NewException(“Common Language Runtime … Read more