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:
- Find a machine on which VS2008 has been installed
- Copy the contents of C:\Program Files\MSBuild\Microsoft\VisualStudio\v9.0\WebApplications to your new machine
- Create your NUnit Test project as a Windows Console Application, not as a Class Library.
- Then make your main Program look like this:
public class Program
static void Main(string args)
[TestCase("Aa - Bb")]
public void WhenValidatingForename_should_accept_valid_characters(string validInput)
var result= new ClassUnderTest().Validate(validInput);
public void WhenValidatingForename_should_reject_invalid_characters(string invalidInput)
var result= new ClassUnderTest().Validate(invalidInput);
- Then, add a reference not only to
nunit.framework.dll but also to
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
Resharper or similar.
NB You may need to check if your build scripts are hard-coded to expect a Test project to be a
Negative lookarounds are usually what you’re after:
matches code not preceded by status
matches code not preceded by status or by post
Negated Character Classes
But to not-match just a single character you can do it with character a class:
Ben Higginbottom makes a significant point right at the top of this question about the Knight Capital fiasco:
Was the Knight Capital fiasco related to Release Management? On August 1, 2012, Knight Capital Group had a very bad day, losing $440 million in forty-five minutes. More than two weeks later, there has been no official detailed explanation of …
Ben Higginbottom: Nightmare scenarios like this are not the result in the failing in any one discrete components that can be ‘fixed’ simply and sweetly by improving the process, but by small failures in multiple domains (I’m kind of reminded of a fatal accident investigation). So coding error, gap in the unit testing, weak end to end testing and poor post release testing coupled with a lack of operational checks when live. I can understand the desire for a ‘silver bullet’ fix, but in any complex system I’ve never known them to exist.
Sometimes, it’s the whole, not the parts, that needs fixing.