7

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.

oscilatingcretin
  • 10,457
  • 39
  • 119
  • 206
  • Did you use your nuget package manager to update to MVC 5 or did you install it? Is your nuget setup to to a shared location? If so, then an update would uninstall the old version and install the new version. If your branches then depend on the old version it might end up breaking. Just a suggestion. – Gjohn Nov 06 '14 at 02:13
  • @Gjohn See edit at bottom of question. I also do not know if it installed in shared location and do not know how to figure that out.' – oscilatingcretin Nov 07 '14 at 19:42
  • check the location of the reference you added using Nuget. Usually they get written to a packages folder but you can configure Nuget to write to a directory of your choosing if you are sharing libraries. Usually if it is just writing to a packages folder that is part of your project it will just contain the packages you installed for that project. If it is a shared location then it should contain pretty much every single package that the various projects use. Also, check your references to see if there are broken references in the project branches that are not working. – Gjohn Nov 07 '14 at 19:58
  • @Gjohn MVC package was installed in project folder only and the reference is pointing to the MVC assembly located there. I checked other project files and there are no broken/missing references. – oscilatingcretin Nov 07 '14 at 20:03
  • once you switch over to the production branch you are just really updating the code and doing a rebuild right? Have you tried to clean the solution and rebuild? – Gjohn Nov 07 '14 at 21:46

2 Answers2

1

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

KnuturO
  • 1,565
  • 15
  • 19
0

had this problem when I added my project to IIS. The reason was - that I had forgotten to add my subproject as a child IIS application.

safinilnur
  • 199
  • 1
  • 4