Skip to main content

Posts

Save All/Format All Documents in Visual Studio

Sub FormatAll()    For Each proj As Project In DTE.Solution.Projects      FormatFileRecur(proj.ProjectItems())    Next End Sub Sub FormatFileRecur(ByVal projectItems As EnvDTE.ProjectItems)    For Each pi As EnvDTE.ProjectItem In projectItems      If pi.Collection Is projectItems Then        Dim pi2 As EnvDTE.ProjectItems = pi.ProjectItems        Try          If pi.Name.EndsWith(".cs") Then            If Not (pi.Name.EndsWith("Designer.cs")) Then               If Not pi.IsOpen Then pi.Open(Constants.vsViewKindCode)             pi.Document.Activate()             DTE.ExecuteCommand("Edit.FormatDocument")             If Not pi.Document.Saved Then pi.Document.Save()             pi.Document.Close()            End If          End If        Catch ex As Exception          'Ignore this error - some project items cannot be opened.                   End Try        If pi2 IsNot Nothing Then          FormatFileRecur(pi2)        End If      End If    Next End Sub
Recent posts

Reduce Windows Folder Size

I just realized that my Windows directory has over 34 GB of stuff. What the heck!!! When you have Office, a couple of versions of Visual Studio, and few other Microsoft programs, you basically have already gobbled up about 80 GB of hard disk space. I found this online and found it to be useful and effective. It shaves off about 8 GB of your Windows folder. Still not what I had expected but I can definitely use 8 GB for other important documents. I'm just puzzled at what is Micros soft putting in an Operating system folder? huh? 28 GB of crap? Open a command prompt (make sure you either have Admin privileges). If you do not have Admin privileges, then open the command prompt as Admin. dism /online /cleanup-image /spsuperseded /hidesp

TF31001 error when connecting to TFS 2010

The Server returned the following error: 246021. An error occurred while processing your request. Technical Information (for Administrator): SQL Server Error 1934 (retry) This error is caused due to SQL Server Server settings of "noCount" and/or "numeric round about" being turned on. Run ssms.exe, right click on the SQl Server node, and invoke the Proerties dialog. Select the "Connections" node, and turn off both items.

Track Files in Visual Studio

By default, Visual Studio’s Solution Explorer will update its selected item based on the currently active document. This is extremely annoying as it keeps expanding your projects and folders until your solution explorer becomes unmanageable and unusable, unless you collapse all Projects (Only available if you have Visual Studio Power Commands) installed) and even then, after collapsing the entire solution, the saga returns back. Turn off Active tracking 1. Turn your Active tracking off by going to Tools > Options 2. Select “Projects and Solutions” node 3. Uncheck the “Tack Active Item in Solution Explorer” Add a macro to do on-demand tracking 4. Tools > Marcos > Macro Explorer 5. You will see “MyMacros” Module (Node). Right mouse click on MyMacros and invoke “New Module…” 6. Name it anything you like. I Named it Utilities 7. Right mouse click on Utilizes and invoke “new Macro…” menu. The Macros IDE window opens. 8. Paste in the following into it within the Publ

Google Instant search

Google Instant Search is the worst feature ever!!!. I could not for the life of me find a PERMANENT way to turn it off. Every time I turned it off using different means, it always came back. This is the only link I found useful so far, but the suggestion is not that great. It's OK. http://www.google.com/support/forum/p/Web%20Search/thread?tid=2a8bc9c3770bc11b&hl=en It is so annoying and so intrusive, every time I type a character it interrupts me and then I end up because of the time lag with a different string in the search box than the one I intended to type. Are they hiring a whole new set of STUPID generation at Google. This does not take a rocket scientist to figure out that this feature is useless. Even if they believe that is has some usefulness, let me (the customer, the user) decide. Anyone knows how to turn this stupid feature off?