exception after logging in to backoffice in working 6.1.6 umbraco web app upgraded to 7.6.5
Several years ago, we successfully created an ASP.NET MVC4 web application into which we added umbraco. We had created MvcApplication descended from Umbraco.Web.UmbracoApplication. But it was set up to run umbraco side-by-side with our MVC web application. Most of the functionality was in our own controller's, descended from System.Web.Mvc.Controller. We have set up all our own routes. We also have a set of Web Api controllers descended from System.Web.Http.ApiController. All of this was working fine with 6.1.6.
But because we need to add new libraries to the MVC web application, we need to upgrade umbraco --- up to or beyond 7.4.3.
We decided on 7.5.6.
It's quite an upgrade since it pushes our application from MVC4 to MVC5.
We were able to do the install via nuget and to get the web application to run fine EXCEPT we run into problems immediately after logging into the BackOffice. Immediately after logging into, after the PostLogin finishes and the umbraco page starts loading we will get an error: In Chrome console, you will see:
http://localhost/umbraco/backoffice/UmbracoTrees/ApplicationTree/GetApplicationTrees?application=content&tree=&isDialog=false 500 (Internal Server Error)
And when you look (in Chrome console response body)
{"Message":"An error has occurred.","ExceptionMessage":"A route named 'WebAPI/Lanugages/GetAllLanguages' is already in the route collection. Route names must be unique.
The Route Name mentioned is one of our custom routes for one of our ApiController-descended controllers.
When I drill into to stack trace to see what is happening, I see that umbraco is trying to re-add all the routes that were added on application start.
That is, when I go back to application start and see the route collection right after application start, I see something like 63 routes.
And now following login to the BackOffice, I see umbraco trying to re-add the same routes to those 63 routes that were already in the collection.
As an experiment, I went to the problem controller and route:
public class LanguageController : ApiController
{
[Authorize(Roles = "CacheAdmin")]
[HttpGet]
[Route("cache/clear", Name = "WebAPI/Languages/GetAllLanguages")]
public void ClearLanguageCache()
{
UserLanguageRepository.Reload();
}
and change parent from ApiController to UmbracoApiController. But that doesn't change the error.
I went into web.config, and added "~/api/" to umbracoReservedPaths. But that doesn't change the error.
exception after logging in to backoffice in working 6.1.6 umbraco web app upgraded to 7.6.5
Several years ago, we successfully created an ASP.NET MVC4 web application into which we added umbraco. We had created MvcApplication descended from Umbraco.Web.UmbracoApplication. But it was set up to run umbraco side-by-side with our MVC web application. Most of the functionality was in our own controller's, descended from System.Web.Mvc.Controller. We have set up all our own routes. We also have a set of Web Api controllers descended from System.Web.Http.ApiController. All of this was working fine with 6.1.6.
But because we need to add new libraries to the MVC web application, we need to upgrade umbraco --- up to or beyond 7.4.3.
We decided on 7.5.6.
It's quite an upgrade since it pushes our application from MVC4 to MVC5.
We were able to do the install via nuget and to get the web application to run fine EXCEPT we run into problems immediately after logging into the BackOffice. Immediately after logging into, after the PostLogin finishes and the umbraco page starts loading we will get an error: In Chrome console, you will see: http://localhost/umbraco/backoffice/UmbracoTrees/ApplicationTree/GetApplicationTrees?application=content&tree=&isDialog=false 500 (Internal Server Error) And when you look (in Chrome console response body) {"Message":"An error has occurred.","ExceptionMessage":"A route named 'WebAPI/Lanugages/GetAllLanguages' is already in the route collection. Route names must be unique.
The Route Name mentioned is one of our custom routes for one of our ApiController-descended controllers.
When I drill into to stack trace to see what is happening, I see that umbraco is trying to re-add all the routes that were added on application start.
That is, when I go back to application start and see the route collection right after application start, I see something like 63 routes.
And now following login to the BackOffice, I see umbraco trying to re-add the same routes to those 63 routes that were already in the collection.
As an experiment, I went to the problem controller and route:
public class LanguageController : ApiController { [Authorize(Roles = "CacheAdmin")] [HttpGet] [Route("cache/clear", Name = "WebAPI/Languages/GetAllLanguages")] public void ClearLanguageCache() { UserLanguageRepository.Reload(); } and change parent from ApiController to UmbracoApiController. But that doesn't change the error.
I went into web.config, and added "~/api/" to umbracoReservedPaths. But that doesn't change the error.
is working on a reply...