7

I've installed the "ASP.NET and Web Tools 2013.1" in my Visual Studio 2012.

I have a solution which has an ASP.NET MVC 4 project with the following project type guids:

<ProjectTypeGuids>
  {E3E379DF-F4C6-4180-9B81-6769533ABE47};
  {349c5851-65df-11da-9384-00065b846f21};
  {fae04ec0-301f-11d3-bf4b-00c04f79efbc}
</ProjectTypeGuids>

These Guids are for: ASP.NET MVC 4.0 Web Application Windows (C#)

This is the usual configuration when you create a new ASP.NET 4.0 project. And it works fine.

The problem is that, for some strange reason, whenever I open my solution the first GUID (ASP.NET MVC 4.0) is deleted from the .csproj file, so I lose all the related tooling.

No matter how I try to edit it:

  • if I close the solution, and edit this file manually, adding the missing GUID, when I open it again, the GUID is deleted
  • if I unload the project, edit the .csproj and reload it, the GUID is also deleted.
  • I have this project under version control (SVN), so I have also tried closing VS, updating the file in the SVN (using Tortoise) and reopening the solution. And you know what? The GUID is deleted when opening the solution !!!

If I create a new solution with an ASP.NET MVC 4.0 project, it works fine, and the GUIDs are kept.

Any idea why this can be happening and how I can solve it?

UPDATE

If I open VS in safe mode this doesn't happen. SO I suspect it must be an extension, but I don't know how to discover which is the offendign extension. Is there a way to know which extension can be responsible for this (apart from uninstall/try cycles...)

tereško
  • 58,060
  • 25
  • 98
  • 150
JotaBe
  • 38,030
  • 8
  • 98
  • 117
  • 2
    I am facing the same issue, have you found any solution to this problem? – 101V Jun 23 '14 at 14:39
  • I'm having the same problem. According to this list of product GUIDs, one is for MVC5, one is for MVC4, and the other is for C#. http://www.codeproject.com/Reference/720512/List-of-Visual-Studio-Project-Type-GUIDs ASP.NET MVC 4 {E3E379DF-F4C6-4180-9B81-6769533ABE47} ASP.NET MVC 5 {349C5851-65DF-11DA-9384-00065B846F21} C# {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} I'm not sure if 4 and 5 can be or should be mixed. I added one GUID manually to get scaffolding to work (http://www.asp.net/visual-studio/overview/2013/aspnet-scaffolding-overview). According to that link, VS2013 is required. – user576154 Sep 21 '15 at 16:46

1 Answers1

0

I found a temporary workaround hack for this problem:

  1. Right click on the MVC project in Visual Studio and select "Unload Project"

  2. Right click on the project and select "Edit YourProjectName.csproj"

  3. Replace the contents of the ProjectTypeGuids tag with the following and save the file changes:

    {E3E379DF-F4C6-4180-9B81-6769533ABE47};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}

  4. Open up Window Explorer and find the csproj file. Open up properties on it and mark it as Read Only.

  5. In Visual Studio right click on the project and select Reload Project. You will be prompted to save as the csproj file. Hit Cancel when that comes up.

  6. Go back to Windows Explorer and take off the Read Only flag.

As long has you have this project open in Visual Studio, it will think it's an MVC project, and you will have options to Add Views and Controllers. Once you switch projects or restart Visual Studio, you'll have to do this again.

Community
  • 1
  • 1
Rono
  • 3,171
  • 2
  • 33
  • 58