ASP.NET web.config in different evironment solutions

In a website project you generally have a development environment, testing environment, and production environment. Each of these environments has different web.config settings. Fortunately ASP.NET now provides an elegant way of handling these. You can read all about it here:


.NET Programming Standards and Naming Conventions

Here is a good site for naming standards.

http://10rem.net/articles/net-naming-conventions-and-programming-standards---best-practices

VS 2008 with Team Explorer Unit Test TestContext Error

After upgrading from VS Team System 2005 to VS 2008 with Team Explorer I had a TestContext error when trying to run a unit test. After some research I found that you have to change the reference to Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll from v8 to v9.

Find files that end with "vbp" in Windows 7 file explorer

I was trying to find an old VB 6 project but I couldn't remember the name of it or where it was on my hard drive but I knew I didn't have very many of them so I opened file explorer and typed "*.vbp" in the search box.

This unfortunately returned way too many results because it included *.vbproj files. I wanted just files that ended with "*.vbp" After some searching I found this http://windows.microsoft.com/en-ca/windows7/advanced-tips-for-searching-in-windows which said you could use:

 System.FileName:~<"notes"

to find files that start with "notes" the ~< means "begins with" so I deduced maybe ~> means "ends with" and sure enough to find files that end with "vbp" put this in the search box:

System.FileName:~>"vbp"

Required reading for anyone coding in VB.NET

While at Tech-Ed 2008 in Orlando I picked up a copy of "Professional Refactoring in Visual Basic" by Danijel Arsenovski a Wrox Programmer to Programmer book by Wiley Publishing, Inc.  This book is absolutely the best book I have seen on doing object oriented VB.NET programming in the real world.  In my opinion it is absolutely required reading for anyone coding in VB.NET.

How to add a Solution Folder to an existing Solution Folder with VS 2005 Guidance Automation

If you have an EnvDTE.Project reference to an existing Solution Folder you can add a solution folder like so:

C#

((EnvDTE80.SolutionFolder)root.Object).AddSolutionFolder("solutionFolder");

or VB

DirectCast(root.[Object], EnvDTE80.SolutionFolder).AddSolutionFolder("solutionFolder")

where "root" is the EnvDTE.Project reference to the existing Solution Folder.

How to unlock a file in Team Foundation Server(TFS)

To unlock a file in Team Foundation Server you have to issue the following command at the Visual Studio Command Prompt:

TF UNDO filename /WORKSPACE:workspace;checkout_user /SERVER:servername

Where you change the lower case words with your particular case.  For more information go here:

How to search and replace a return character in Visual Studio

Every once in a while I need to search and replace a character with a "return" character and I forget how to do it and have to search online.  This latest search I found the answer here(it was there in 2008, but it is there longer):

http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=112303

In your search dialog turn on regular expressions and use "\x0d\x0a" for the "return" character.