Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // part of Global.asax.cs
- // R# cannot resolve ~/Views/CloudTransporter/EdiDestinationConfig/Index.cshtml
- protected void Application_Start(object sender, EventArgs eventArgs)
- {
- MvcHandler.DisableMvcResponseHeader = true;
- RouteTable.Routes.MapRoute("Default", "{controller}/{action}", new { controller = "Home", action = "Index" });
- var container = BuildContainer();
- DependencyResolver.SetResolver(new AutofacDependencyResolver(container));
- AddCloudTransporterViewsLocations(ViewEngines.Engines);
- }
- private static void AddCloudTransporterViewsLocations(ICollection<IViewEngine> engines)
- {
- var razorEngine = engines.OfType<RazorViewEngine>().FirstOrDefault();
- if (razorEngine == null)
- return;
- razorEngine.ViewLocationFormats =
- razorEngine.ViewLocationFormats.Concat(new []
- {
- "~/Views/CloudTransporter/{1}/{0}.cshtml"
- }).ToArray();
- razorEngine.PartialViewLocationFormats =
- razorEngine.PartialViewLocationFormats.Concat(new []
- {
- "~/Views/CloudTransporter/{1}/{0}.cshtml"
- }).ToArray();
- }
Advertisement
Add Comment
Please, Sign In to add comment