Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not determine which version of ASP.NET Web Pages to use

Weird goings on with my VS2013 projects. I recently upgraded one of my project branches from .NET 4.0 to 4.5.1 and used NuGet package manager to install MVC 5 with Razor so that I could have a WebForms/MVC hybrid. So far, it's working fine and I am able to use both WebForms and MVC.

However, all of my other branches of the same project (the production branch for example) appear to be broken when they have not changed. When I run one of the other projects, I get:

Could not determine which version of ASP.NET Web Pages to use.

After some looking around, I saw someone recommend putting this in the web.config appSettings:

<add key="webpages:Version" value="2.0.0.0"/>

Now when I run the project, I get this:

HTTP Error 404.0 - Not Found

What else is odd is that the URL is pointing to this:

http://localhost:53305/Account/Login?ReturnUrl=%2findex.aspx

I have no idea how making the change to MVC 5 in a different code branch could impact my other projects which are still straight WebForms using the 4.0 framework.

Edit: It's probably worth noting that my other completely separate WebForms projects still work. It's only the other branches of this particular project that appear to be broken. It's almost as if there's some common configuration file shared between all of these branches that has been modified which ends up accommodating only the branch that was upgraded to MVC 5.

Edit: In case how I installed the NuGet package is in question, here's what I did:

  • Right-clicked my project and selected Manage NuGet Packages
  • Clicked Online in the left pane and selected Microsoft ASP.NET MVC and clicked Install
  • It did whatever it did and installed it for that project.

I do not have this package installed in my other branches. It's only a single branch. Somehow, it affected all branches and I do not know why.

like image 1000
oscilatingcretin Avatar asked Nov 05 '14 17:11

oscilatingcretin


People also ask

How do I know what version of ASP.NET I am using?

From PowerShell: Launch PowerShell as an administrator. Run the command import-module servermanager. ASP.NET 4.5: Run the command get-windowsfeature Net-Framework-45-Core. The output indicates the ASP.NET 4.5 install state ("Installed" or "Available").

How to check if ASP.NET is installed on IIS?

Click Start > Control Panel > Administrative Tools > Internet Information Services (IIS) Manager. On the left pane, expand the entry for Local Computer and click Web Service Extensions. Check that there is an item called ASP.NET v2.


1 Answers

My guess is that you now have alot of .net v2.0 projects and one .net v4.5.1 project in the same solution. Either your IIS express config or IIS configuration is now using an app pool v4.5.1

like image 88
KnuturO Avatar answered Oct 19 '22 01:10

KnuturO