0

OK, so I asked a question here that describes how I have arrived at this conclusion. I have looked around the web and have found similar issues but not one that gives me the answer or that gets me close enough for me to be able to make the leap to pull it altogether. The MVC 4 application that I developed in Visual Studio 2012 targets the .NET 4.0 framework as our production server can not presently be upgraded to .NET 4.5. In VS 2012 and on my local IIS the application runs perfectly. However, when I deployed it to our staging server, which only had .NET 4.0, it would not run completely, although it did display the Login page. It would not, however, display the Register or the Forgot Login pages.

Things I have tried:

  1. running aspnet_regiis.exe -ir, although it was not necessary as we already have ASP.NET 4 apps running - [desperation]
  2. Removing and adding in web.config, UrlRoutingModule-4.0
  3. Ensured all dll's targeted .NET 4.0
  4. ... will list more when I return to work tomorrow

In my continued troubleshooting efforts, I was able to determine that after the user logged in and was authenticated, the only error that was thrown was one stating that it could not locate my error page which existed in the Error directory. After remedying this, it only displayed the error page with no other usable information other than that an error occurred in my Account-Login method. I also checked SQL Server and noticed that the test user's LastLogon field was being updated which verified my connection for SQL and EF5. At this point I added logging and was able to determine that the user was in fact authenticated but the code in the BaseController which was responsible for routing authenticated users to the Home/Index page never seemed to fire (see the full code here).

After exhausting several hours trying to isolate the faulty code, on a whim, I installed .NET 4.5 to the staging server and Lo and Behold, it worked as intended. Could I be using something that is intended for .NET 4.5? The only additional plugins I am using are:

  • TwitterBootstrapMVC
  • Grid.MVC
  • Entity Framework 5.0
  • ... will list more when I return to work tomorrow

and several other JQuery plugins, neither of which require .NET 4.5. I would be more than appreciative if someone could guide me onto the right path to help solve this challenge. I know you guys here, like me, love a challenge. Let's see if anyone can figure this one out before I do.

The only use of an obstacle is to be overcome. All that an obstacle does with brave men is, not to frighten them, but to challenge them.

                                                                      ~ Woodrow Wilson
Community
  • 1
  • 1
Big_Eezy
  • 9
  • 4
  • You stated your using EF 5.0. Possibly you using some of the features not supported by NET 4.0 as [discussed in this answer](http://stackoverflow.com/questions/12168035/entity-framework-5-0-minimum-net-framework-version-required-net-4-0-or-4-5) –  Feb 19 '15 at 05:57
  • Thanks Stephen, excellent suggestion, however, I am using Code First with EF5 but I am not using any of the new features that require 4.5 as I began this project targeting 4.0 after upgrading to VS 2012. I will verify this once I get to work but I am certain that I am not using Enum support nor does my application utilize spatial data types. I will try changing to EF4.3 and see if the results differ. Thanks again Stephen. – Big_Eezy Feb 19 '15 at 11:19

1 Answers1

0

OK, I discovered what was going wrong. For some of my Controllers, I needed an additional parameter and I did not want to use QueryString so I added an additional url parameter to my RouteConfig:

routes.MapRoute(
    name: "Default",
    url: "{controller}/{action}/{id}/{xid}",
    defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional, xid = UrlParameter.Optional }
);

Haven't had much time to research why this would work in 4.5 and not 4.0 but when I find it, I will post an explanation or a link to an explanation here, just in case someone finds themselves in a similar pickle. And if anyone reading cares to expound on this, please feel free.

Big_Eezy
  • 9
  • 4