4.1 upgrade breaks URL resolution on all my pages
All my pages are giving me the following error. How can I fix this?
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
|
Do you have custom widgets or layout controls?
yes to both
That's the problem I believe
I have a similar issue...they told me to execute this code
string
LayoutControlType =
typeof
(InfoPod).FullName;
string
LayoutPropName =
"Layout"
;
var upg =
PageManager.GetManager().GetProperties()
.Where(prop =>
prop.Name == LayoutPropName
&& prop.Control.ObjectType == LayoutControlType
&& prop.Value ==
""
)
.ToArray();
foreach
(var layoutProperty
in
upg)
layoutProperty.Value =
"~/OCFP/OCFP.Layouts.Views.InfoPod.ascx"
;
LayoutControlType =
typeof
(Award).FullName;
LayoutPropName =
"Layout"
;
upg =
PageManager.GetManager().GetProperties()
.Where(prop =>
prop.Name == LayoutPropName
&& prop.Control.ObjectType == LayoutControlType
&& prop.Value ==
""
)
.ToArray();
foreach
(var layoutProperty
in
upg)
layoutProperty.Value =
"~/OCFP/OCFP.Layouts.Views.Award.ascx"
;
OCFP.Layouts.Views.InfoPod.ascx
~/OCFP/OCFP.Layouts.Views.Award.ascx
Steve, thank you so much for your reply. My original error was something slightly different but after I resolved that, I immediately ran into the error you've graciously outlined for me.
Have you been able to get your layouts working using what they've told you to do? I added the virtual path configuration entry, changed all the layout property values to the new virtual path format, but now I just get "
System.IO.FileNotFoundException: ~/my_assembly/my_assembly.Resources.ControlTemplates.Layouts.Main.ThreeColumn.ascx" instead of the old "Invalid Layout Template".
What's odd is that the layouts work fine in design mode and when I preview the page. The problem arises on the live page.
Wierd that you sent this just now...Im literally JUST trying to implement this this minute
I had the same issue...preview was fine, live was borked...thats why I figured we have the same problem.
This code needs an update through
string
LayoutControlType =
typeof
(InfoPod).FullName;
string
LayoutPropName =
"Layout"
;
var upg =
PageManager.GetManager().GetProperties()
.Where(prop =>
prop.Name == LayoutPropName
&& prop.Control.ObjectType == LayoutControlType
&& prop.Value ==
""
)
.ToArray();
foreach
(var layoutProperty
in
upg)
layoutProperty.Value =
"~/OCFP/OCFP.Layouts.Views.InfoPod.ascx"
;
PageManager.GetManager().SaveChanges();
So your global asax looks like this?
protected void Application_Start(object sender, EventArgs e)
Telerik.Sitefinity.Abstractions.Bootstrapper.Initializing += new EventHandler<
Telerik.Sitefinity.Data.ExecutingEventArgs
>(Bootstrapper_Initializing);
protected void Bootstrapper_Initializing(object sender, Telerik.Sitefinity.Data.ExecutingEventArgs args)
if (args.CommandName == "RegisterRoutes")
var virtualPathConfig = Config.Get<
VirtualPathSettingsConfig
>();
var jobsModuleVirtualPathConfig = new VirtualPathElement(virtualPathConfig.VirtualPaths)
VirtualPath = "~/my_asembly/*",
ResolverName = "EmbeddedResourceResolver",
ResourceLocation = "my_asembly"
;
virtualPathConfig.VirtualPaths.Add(jobsModuleVirtualPathConfig);
ALSO!
If your layout controls have IDs specified you're supposed to remove those (the runat="server" ones) or impliment the (stupid) NamingContainer
So just a heads up too (after restoring my DB)
It seems that removing the IDs was the problem, had nothing to do with the code the agent sent me....so Im not even going to run that yet on this freshly restored db
**EDIT** scratch that, still needed to be run, but still getting yellow screens of death allover the place...4.1 is such a pain in the ass
- I did catch that the manager needed to call SaveChanges(), sorry I should have said something
- my global.asax does look just like that
still, my errors alternate between the "FileNotFound" and "Invalid layout template" screens.
"If your layout controls have IDs specified you're supposed to remove those (the runat="server" ones) or impliment the (stupid) NamingContainer" -- I don't quite understand what you mean here, do you mean to remove the IDs?
I have a day to make 4.1 work before we revert back to 4.0 sp1... thanks so much for all your input thus far, and I'd hugely appreciate it if you could keep this thread updated if you make any progress with this nastiness.
Yeah I know all the documentation shows each Div in the layout needs an ID...but I am being told to remove the IDs...and really once I did the page RENDERED, but stuff was allover the place and edit mode shows me none of that content. So it's got to be that SF wants to render content in Placeholder (layout) X, but that name doesn't exist anymore perhaps because the ID is gone. So I have no doubt that starting from scratch this would all just work. But I've spent the last few weeks creating the structure, entering content, and fixing URLs, and damned if I want to go back and do that AGAIN.
So screw it, back to the support tickets, maybe Radoslav has an idea...I don't want to have to go back through every page to fix everything...