I have upgraded to MVC3 and Razor, everything works fine. However, in my return View(model);
the "View" is red and VS2010 will helpfully suggest I generate a view. When I do, it generates a aspx/WebForms view. There's no other aspx files in the project, and if I run the project, the Razor view engine works fine. There's obviously a setting somewhere that tells VS2010 which to default to, I can't find it. Any suggestions?
相关问题
- Visual Studio 2010 randomly says the command line
- (ASP.NET) Project file must include 'WindowsBa
- Entity Framework throws exception - Network Relate
- Partial Form Class C# - Only display code view for
- Slow loading first page - ASP.NET MVC
相关文章
- How to show location of errors, references to memb
- “Dynamic operations can only be performed in homog
- Log4Net Multiple Projects
- Compiling error in C++ project with C and C++ code
- How to use Mercurial from Visual Studio 2010?
- Change color of bars depending on value in Highcha
- How to get server path of physical path ?
- VSIX: execute code on VS startup
If you can create a new ASP.NET MVC 3 project and add a Razor view as expected then the project where you are seeing this behavior is missing the ASP.NET MVC 3 project type guid, which you can find in a new ASP.NET MVC 3 project's .csproj file. If you can't do this than you should try reinstalling the ASP.NET MVC 3 Tools Update.
These are not explicit answer but rather a list of actions that you could try..
<ProjectGuidType>
are set to<ProjectTypeGuids>{E53F8FEA-EAE0-44A6-8774-FFD645390401};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
ProjectGuid
to some other Guid (last post). You will need to update the sln file or simply recreate the solution.