0

I have MVC app and I try to access mobile area.

So I decided to use integrated to chrome mobile mode.

My start controller is Account/Login

Here is code of ApplicationStart

 protected void Application_Start()
        {
#if DEBUG
            XmlConfigurator.ConfigureAndWatch(new FileInfo(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "logging_DEBUG.config")));
#else
            if (AppDomain.CurrentDomain.BaseDirectory.Contains("DevTrackerweb")
               || AppDomain.CurrentDomain.BaseDirectory.Contains("Trackerweb4Test"))
            {
                XmlConfigurator.ConfigureAndWatch(new FileInfo(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "logging_DEBUG.config")));
            }
            else
                XmlConfigurator.ConfigureAndWatch(new FileInfo(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "logging.config")));
#endif

            var log = LogManager.GetLogger(AppDomain.CurrentDomain.BaseDirectory);
            log.Info("Application start");

            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            ModelBinders.Binders.Add(typeof(decimal), new DecimalModelBinder());
            ModelBinders.Binders.Add(typeof(decimal?), new NullableDecimalModelBinder());

            Translator.Prefetch().Wait();

            HttpContext.Current.Application.Add("TrackerwebServiceStatus", TrackerwebServiceStatus.OK);

            sitesByHostName = InitializeSites();
            mainCustomerIDByCustomerID = InitializeCustomerIDDictionary();
        }

When I run it, I have this

enter image description here

How I can solve this problem?

phuzi
  • 12,078
  • 3
  • 26
  • 50
mark_spencer
  • 393
  • 4
  • 17

2 Answers2

0

My guess is your login page/action is not configured for anonymous access. Try adding the AllowAnonymous attribute to the Login action method.

Moho
  • 15,457
  • 1
  • 30
  • 31
0

So problem was in that it was legacy code and I have MvcSiteMap extension ,that I deleted.

In web config I had some code related to this extension and when I deleted it all okay

mark_spencer
  • 393
  • 4
  • 17