0

The app is running without error on my computer with W10, VS2017 (Net Framework 4.5) & SQLServer Express 2012. but when I publish to the hosting provider I get this message.

Server Error in '/' Application. Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:

System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.] Microsoft.AspNet.FriendlyUrls.FriendlyUrlsModule.RedirectToFriendlyUrl(HttpContextBase httpContext, IFriendlyUrlRoute route, IVirtualPathUtility virtualPathUtility) +373 Microsoft.AspNet.FriendlyUrls.FriendlyUrlsModule.b__0(Object sender, EventArgs e) +171 System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +141 System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +48 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +71

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.2634.0

What am I doing wrong?

Juan M.
  • 1
  • 2
  • Please provide source code, as finding the nullref won't work without seeing where it occured – FallenWarrior Jul 05 '18 at 11:51
  • Hi @FallenWarrior, this happens when the the app starts, before showing any page. This is my standard RouteConfig.cs public static class RouteConfig { public static void RegisterRoutes(RouteCollection routes) { var settings = new FriendlyUrlSettings(); settings.AutoRedirectMode = RedirectMode.Permanent; routes.EnableFriendlyUrls(settings); } } – Juan M. Jul 07 '18 at 23:07
  • Hi folks, i've downgraded Microsoft.AspNet.FriendlyUrls to V1.0.0 and this issue disapears but frienlyurl's doesn't works. but when i restore V1.0.2 this appears again. – Juan M. Aug 01 '18 at 18:08

0 Answers0