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.

BootCamp Drivers – Direct Download of BootCampESD.pkg for Macs to Run Windows 7 or Windows 8

Do you find that BootCamp assistant download is stuck or or fails or could not continue?

The brute force solution: it's a darned large download, so physically take your machine to somewhere with a very fast internet connection that can download 600MB - 1GB in a couple of minutes. There, you're done.

For the rest of us, there are 2 options:

The simple solution – recommended – is to use this list of Windows driver download links for Macs with OS X Mountain Lion (which includes all retina display macs) or Lion, Snow Leopard or Leopard. That's about everything back to 2007.
There are also older links here, but they appear to be redundant -- the Mountain Lion file covers Mac models going back to Leopard.

Finally, the DIY solution: Work out for yourself which download link you need.

The DIY way to find your BootCampESD.pkg download link from the sucatalog

Not for the faint-hearted.

  • Apple software update uses an sucatalog file, which contains a link to a BootCampESD.pkg file which contains the drivers. The sucatalog file in question contains several different links to bootcampesd.pkg, fordifferent Mac models. How to find the right one for your machine?
  • Tim Valenta did instructions in Nov 2011 that nearly worked for me in June 2012 at http://blog.timvalenta.com/2011/11/19/boot-camp-driver-downloads/ except that again, 6 months on, the catalog file seems to be laid out everso slightly differently; and the file downloaded is now in an easier to use format.
  • My steps to download the Lion or Mountain Lion drivers were as follows:

    How to Manually Download Windows Drivers for Macs Running BootCamp 4 or BootCamp 5

    1. Download from apple the http://swscan.apple.com/content/catalogs/others/index-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog file. Don't double-click it, that won't help.
    2. Instead, open it in a text editor or word processor.
    3. Search for each occurrence -- as at August 2012 there were 6 -- of BootCampESD.pkg. For instance, the one I needed is http://swcdn.apple.com/content/downloads/33/54/041-2011/pRtCDYcWShMLxFggy3TzFzmfnnWQNFQBfJ/BootCampESD.pkg
    4. Notice in each such URL, the /041-2011/ or similar /041-XXXXX/ bit of it.
    5. Below each such occurrence, notice a URL for a file with the same 041-XXXXX in it and ending in English.dist, e.g. 041-2011.English.dist
    6. Paste the URL for each such English.dist file into your browser and open the Url. Here's a list of them:
    7. Search for the Model Identifier for your Mac. For instance MacBookPro5,2 or Macmini4,1 or whatever
      • For instance the 041-2011 file contains these models: MacBook2,1 MacBook3,1 MacBook4,1 MacBook5,1 MacBook5,2 MacBook5,3 MacBook6,1 MacBook7,1 MacBookAir1,1 MacBookAir2,1 MacBookAir3,1 MacBookAir3,2 MacBookPro2,1 MacBookPro2,2 MacBookPro3,1 MacBookPro4,1 MacBookPro5,1 MacBookPro5,2 MacBookPro5,3 MacBookPro5,4 MacBookPro5,5 MacBookPro6,1 MacBookPro6,2 MacBookPro7,1 MacBookPro8,1 MacBookPro8,2 MacBookPro8,3 MacPro1,1 MacPro2,1 MacPro3,1 MacPro4,1 MacPro5,1 Macmini2,1 Macmini3,1 Macmini4,1 iMac5,1 iMac6,1 iMac7,1 iMac8,1 iMac9,1 iMac10,1 iMac11,1 iMac11,2 iMac11,3 iMac12,1 iMac12,2
      • How do you know your Model Identifier? Open System Information, and look in the Hardware Overview section. i.e. click Apple menu -> About this Mac -> More Info… -> Report -> Hardware -> and now read down the Hardware Overview looking for "Model Identifier:"
    8. Having found your 041-XXXXX number, download the BootCampESD.pkg url that has your number in it. I try to keep the page at bootcamp-driver-download up to date with all the pkg download URLs.
    9. Be patient as it's probably 600MB.
    10. Once your pkg is downloaded, double click it and install to a folder on your hard drive so you know where to find it.
    11. The folder contains a nest of folders, the last of which contains a dmg disk image file. Double click to open. Voila. Here are your Windows installer files. Again, the page at bootcamp-driver-download has pictures to help.
    12. Copy them to a thumb drive or a burnable CD or something. The point here is that you need the somewhere that a new install of windows with only minimal drivers can read them. NB, it's still 660MB or more, so it's a full CDs worth of burning time.
    13. You can now proceed with Boot Camp assistant Windows installation, which will eventually reboot your machine for startup in Windows.
    14. Once you're in Windows, run the installer that you saved to CD or thumb drive.
    15. Done. Marvel as all your Apple hardware now works nearly as well as it does in Mac OS X.