Skip to content
This repository has been archived by the owner on Jun 16, 2022. It is now read-only.

Could not load control: '/Umbraco/UrlTracker/InfoCaster.Umbraco.UrlTracker.UI.UrlTrackerManagerWrapper.ascx' #175

Closed
davyme opened this issue Nov 8, 2017 · 3 comments
Labels

Comments

@davyme
Copy link

davyme commented Nov 8, 2017

Yesterday I've been looking all over the internet looking for a solution to this error:

Could not load control: '/Umbraco/UrlTracker/InfoCaster.Umbraco.UrlTracker.UI.UrlTrackerManagerWrapper.ascx'. Error message: System.Web.HttpException (0x80004005): The file '/Umbraco/UrlTracker/InfoCaster.Umbraco.UrlTracker.UI.UrlTrackerManagerWrapper.ascx' does not exist. at System.Web.UI.Util.CheckVirtualFileExists(VirtualPath virtualPath) 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.UI.TemplateControl.LoadControl(VirtualPath virtualPath) at Umbraco.Web.UI.Umbraco.Dashboard.UserControlProxy.OnInit(EventArgs e)

Many people seem to have the issue, but no one has found an good answer. I believe the answer can be found here:
https://stackoverflow.com/a/4433225

In brief: HostingEnviornment explicitly ignores Virtual Path Providers in precompiled sites.

In UrlTrackerPreApplicationStart.cs:
HostingEnvironment.RegisterVirtualPathProvider(new EmbeddedResourcesVirtualPathProvider());
Has to be replaced with:
typeof(HostingEnvironment).GetMethod("RegisterVirtualPathProviderInternal", BindingFlags.Static | BindingFlags.InvokeMethod | BindingFlags.NonPublic) .Invoke(null, new object[] { new EmbeddedResourcesVirtualPathProvider() });

@daniel-chenery
Copy link
Collaborator

Thanks,

I've seen people have this issue before, but never managed to replicate it. Without replication, it's difficult to fix.

Are you on a specific hosting environment which is causing this problem?

@davyme
Copy link
Author

davyme commented Nov 8, 2017

Indeed, I saw yesterday that lots of people had the issue, that's why I've provided this solution (or so I hope).
The .ascx controls are working on localhost, but not on our dev server, which is Windows Server 2012R2 with IIS 8.5. The only difference in setup is that the server has a precompiled version running. By investigating that angle, I've stumbled upon the stackoverflow article above.

@daniel-chenery
Copy link
Collaborator

Duplicate of #158

@daniel-chenery daniel-chenery marked this as a duplicate of #158 Dec 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants