VS2010 Command Prompt Here on the Windows Explorer Right Click Menu — the .reg File

VS2010 Command Line Here for Explorer Right Click Menu

To add a Visual Studio 2010 Command Prompt Here to your Explorer Right-Click menu, save this as a .reg file to your desktop, and then run it:

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\Command Line VS2010]
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\Command Line VS2010\command]
@="cmd.exe /k echo on & pushd \"%1\" & \"C:\\Program Files\\Microsoft Visual Studio 10.0\\VC\\vcvarsall.bat\" x86"

If you have 64-bit Windows, you'll need this:

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\Command Line VS2010]
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\Command Line VS2010\command]
@="cmd.exe /k echo on & pushd \"%1\" & \"C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\vcvarsall.bat\" x86"

Can’t open Asp.Net MVC2 project in Visual Studio 2010 – Microsoft.WebApplication.targets was not found

You try to open an MVC2 project that worked on a previous machine but won't open on your new machine? The error message you get when you try to open the project is:

error MSB4019: The imported project "C:\Program Files\MSBuild\Microsoft\VisualStudio\v9.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

Possibly your new machine has never had Visual Studio 2008 on it, whereas your old machine did. In which case the solutions is:

  1. Find a machine on which VS2008 has been installed
  2. Copy the contents of C:\Program Files\MSBuild\Microsoft\VisualStudio\v9.0\WebApplications to your new machine

References

http://www.matthidinger.com/archive/2008/11/09/fixing-web-application-projects-with-automated-tfs-builds.aspx

Opening a BootCamp Drivers download or other pkg or dmg file on Windows 7 or 8 with 7-Zip

If you've downloaded bootcamp drivers for Macs to run Windows 7 or 8, but have done the download in Windows, you may be stuck on how to open the downloaded BootCampESD.pkg file you've now got.

The answer is to get a copy of 7-zip, which is free, and which is your 'Swiss army knife' to open the Apple .pkg and .dmg files and the ISO file inside.

  1. Launch 7-zip
  2. In 7-zip, open the BootCampESD.pkg. Inside you'll find a Payload file and a few other files. Double click the Payload file.
  3. Inside is a folder, which you double click. Inside that another folder, which you double click. Inside that ... just keep clicking down the levels of nested folders.
  4. Eventually, several levels down, you'll get to a file called 0.Apple_ISO or some such.
  5. Now, extract this o.Apple_ISO to the desktop (or somewhere) and rename it to Apple.ISO.
  6. Now, either: Mount it by double clicking it—should work in Windows 7—or else by getting hold of PowerISO or similar; OR use 7-zip again to open this ISO file, and extract the contents to a folder.
  7. These are you driver installers. Create an empty folder on your desktop, and drag them out into it.
  8. Finally, open the folder you just created, and run the setup.exe

How to create an NUnit test project that is also a self-running console app .exe

  1. Create your NUnit Test project as a Windows Console Application, not as a Class Library.
  2. Then make your main Program look like this:
    [TestFixture]
    public class Program
    {
        static void Main(string[] args)
        {
            NUnit.ConsoleRunner.Runner.Main(
                new[]{Assembly.GetExecutingAssembly().Location }
                );
        }
    
        [TestCase("Aa - Bb")]
        public void WhenValidatingForename_should_accept_valid_characters(string validInput)
        {
            var result= new ClassUnderTest().Validate(validInput);
            Assert.IsTrue(result);
        }
    
        [TestCase("X<")]
        public void WhenValidatingForename_should_reject_invalid_characters(string invalidInput)
        {
            var result= new ClassUnderTest().Validate(invalidInput);
            Assert.IsFalse(result);
        }
    }
  3. Then, add a reference not only to nunit.framework.dll but also to nunit-console-runner.dll

You now have a self-running executable that runs all your tests, but still behaves in the usual way in a build script, or when running tests inside Visual Studio with TestRunner or Resharper or similar.
NB You may need to check if your build scripts are hard-coded to expect a Test project to be a .dll.