Lecoati / LeBlender

LeBlender is an open source Umbraco backoffice extension which made the Grid Canvas Editors management easier and flexible.
30 stars 63 forks source link

LeBlender will not work when Umbraco hosted in a virtual directory #11

Open codedemonuk opened 9 years ago

codedemonuk commented 9 years ago

When Umbraco is hosted in a virtual directory, then LeBlender will not work correctly because all of the URLs is uses start with '/' which means that unless Umbraco is in the site root, they will not resolve correctly.

It is possible to work around some of the JS references using URL rewrite rules, but you can not change the location is tries to POST any changes to.

It also means that when trying to render content server site, you get an error because it is trying to access content which .Net believes is outside of the current running application.

An example of the stack trace you receive when trying to render a page is:

System.ArgumentException: The virtual path '/app_plugins/leblender/editors/leblendereditor/views/base.cshtml' maps to another application, which is not allowed.
   at System.Web.Compilation.BuildManager.ValidateVirtualPathInternal(VirtualPath virtualPath, Boolean allowCrossApp, Boolean codeFile)
   at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
   at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
   at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound)
   at System.Web.Mvc.BuildManagerWrapper.System.Web.Mvc.IBuildManager.FileExists(String virtualPath)
   at Microsoft.Web.Mvc.ViewEngineFixWorker`1.GetPathFromSpecificName(ControllerContext controllerContext, String name, String cacheKey, String[]& searchedLocations)
   at Microsoft.Web.Mvc.ViewEngineFixWorker`1.GetPath(ControllerContext controllerContext, String[] locations, String[] areaLocations, String locationsPropertyName, String name, String controllerName, String cacheKeyPrefix, Boolean useCache, String[]& searchedLocations)
   at Microsoft.Web.Mvc.ViewEngineFixWorker`1.FindPartialView(ControllerContext controllerContext, String partialViewName, Boolean useCache)
   at Umbraco.Core.Profiling.ProfilingViewEngine.FindPartialView(ControllerContext controllerContext, String partialViewName, Boolean useCache)
   at System.Web.Mvc.ViewEngineCollection.Find(Func`2 lookup, Boolean trackSearchedPaths)
   at System.Web.Mvc.HtmlHelper.FindPartialView(ViewContext viewContext, String partialViewName, ViewEngineCollection viewEngineCollection)
   at System.Web.Mvc.HtmlHelper.RenderPartialInternal(String partialViewName, ViewDataDictionary viewData, Object model, TextWriter writer, ViewEngineCollection viewEngineCollection)
   at System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData)
   at ASP._Page_Views_Partials_grid_editors_base_cshtml.Execute() in d:\Apps\UmbracoCmsGreen\Website\CMS\Views\Partials\Grid\Editors\Base.cshtml:line 20
ismailmayat commented 8 years ago

I am also having this issue, I used url rewrite and that gets me working up to a point but on front end of the site i get same error.

rpjengaard commented 7 years ago

Is there any plan on making LeBlender working in a virtual directory. I have a problem using LeBlender in Azure WebApp, and i think it is because of this issue. Works great local and on our stage environment, but not when deployed to Azure WebApp.

I will gladly help if you guys could point me in the right direction.

best regards René