Not a subscriber?

Join thousands of others who are building self-directed lives through creativity, grit, and digital strategy—breaking free from the 9–5.
Receive one free message a week

ASP.NET MVC without Installing the MVC Bits

I was recently was helping out a collague with an ASP.NET MVC problem and I was given a link to a solution. I opened it and got this message:

image

Which ends up giving you the following in the solution explorer.

image

The reason I’m getting this is because I never installed the ASP.NET MVC bits, well, actually that’s a lie. I have them, but I never installed the full ASP.NET MVC package. I unzipped the MSI with the following command prompt:

#> msiexec –a PathToMsi.msi

This will drop the MSI contents your output to your C:\ drive. Here’s the help window for the msiexec (app click for larger):

image

If you’re like me, and have the bits local, then this can be a pain. Again, the underlying reason is I did not install the MSI which contains a project template which this project is using. Its actually using a particular ProjectTypeGuid in the csproj file. This guid is:

603c0e0b-db56-11dc-be95-000d561079b0

This tells Visual Studio that this project is an ASP.NET MVC file. To open this project in Visual Studio, remove this guid.

Change the project file from this:

{603c0e0b-db56-11dc-be95-000d561079b0};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}

…to this…

{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}

Now re-open and you’ll see the project loaded successfully.

image

 

The only thing you’ll have to do is fix your references in your project as they will probably be broken. Point the references back to the ASP.NET MVC binaries stored locally on your machine.