After 4.1 Upgrade - Blog Not loading...
I have many issues that arose after the upgrade. Here is one in particular.
1.) My blog is no longer working: Error below:
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0102: The type 'ASP.sfpageservice_d12edd17_5884_46ab_a1bf_6d1f87e7b8aa_inforetail_aspx' already contains a definition for 'C000'
Source Error:
Line 50: <
sf:SearchBox
ResultsPageId
=
"c0ac7629-24b6-4c03-a323-216e78d17462"
WordsMode
=
"AllWords"
SearchIndexPipeId
=
"3ff33c61-5b8b-4b4b-9eab-e0aba8ff779b"
ID
=
"T7B35E7F6007"
runat
=
"server"
>
Line 51: </
sf:SearchBox
></
asp:Content
><
asp:Content
ContentPlaceHolderID
=
"copyright"
runat
=
"Server"
>
Line 52: <
sf:NewsView
ContentViewDisplayMode
=
"Automatic"
ID
=
"C000"
runat
=
"server"
>
Line 53: <
ControlDefinition
ControlDefinitionName
=
"NewsFrontend"
UseWorkflow
=
"True"
ProviderName
=
""
runat
=
"server"
>
Line 54: <
Dialogs
> </
Dialogs
> <
Views
><
sf:ContentViewDetailDefinition
ControlDefinitionName
=
"NewsFrontend"
SectionCssClass
=
""
FieldCssClass
=
""
ParentTitleFormat
=
""
Description
=
""
ResourceClassId
=
"NewsResources"
ConfigDefinitionPath
=
"newsConfig/contentViewControls/NewsFrontend/views/NewsFrontendDetails"
TemplateName
=
""
Title
=
""
TemplatePath
=
""
ShowSections
=
"False"
ViewName
=
"NewsFrontendDetails"
DisplayMode
=
"Read"
TemplateKey
=
""
runat
=
"server"
>
Source File: /SFPageService/d12edd17-5884-46ab-a1bf-6d1f87e7b8aa_InfoRetail.aspx Line: 52
seems like a similar experience here but didnt happen to me on the blog page.
http://www.sitefinity.com/account/support-tickets/view-ticket.aspx?threadid=415673
I just upgraded and got almost the same issue. It occurs on a bunch of (but not all) pages within my site.
Compiler Error Message: CS0102:
The type
'ASP.sfpageservice_6392dae1_fdbe_41f2_bd65_7e1324257792_arts_for_all___primary_aspx'
already contains a definition for 'C000'
It's referring to an image control
<sf:ImageControl ImageId="009013e9-14c8-408a-8b25-ed66d9314af9" ID="C000" CssClass="mainImage" runat="server">
Any ideas on how to fix this?
refer to my post above jay, you have a few components or widget blocks/divs on the page with the same id #. you'll need to make them all unique.
Thanks Brandon. You link above is to a support ticket so I couldn't access it.
I'm going back and updating the IDs for the controls on all the pages now which fixes the problem. It's just very annoying that these pages all worked fine and then the upgrade randomly broke everything.
oh sorry didnt realize everyone else couldnt see that link.
yea you'll have to manually go thru and change id # on all widgets/components that are giving this error.
annoying i know but the only fix.
Hi Jay, Brandon and Scott
You are right, the way to fix those errors is by changing the IDs of controls. The problem is that our template parser used to hide these errors before, although they were still a problem. Now that we switched to the virtual path provider, they appear in some places.
We knew this would happen, but annoying or not, it was going to happen at some point anyway. We just though we'd better release this change early than late.
So.... the solution is for us to go find each control and give it a new ID? Why wouldn't the update find competing controls and apply new ID's?
Moreover, why aren't they right (or unique) in the first place?? I didn't set the IDs for these things. The designer did. If I have to go into every control on every page/template and set the IDs myself, why do I need a CMS system? The whole point is to make my life easier not exponentially more difficult.
I ran into this issue on the upgrade, and it is fairly ridiculous that I have to handle this kind of thing. All one asks is that the designer not lay down controls with duplicate IDs...is that so hard? I can't sit around validating something like this all day long.
I hope Telerik takes a long hard look at this, because my "upgrade" is a disaster at the moment. We have 70+ pages. We have these types of errors on EVERY page!!! Pretty much anywhere there is a ContentBlock or user control put on a page. We ABSOLUTELY need a fix for this from Telerik that doesn't involve going into potentially many controls on every page of the entire website to fix.
If this is the kind of "upgrade" we can look forward to in the future, please.... no more "upgrades".
We actually rolled back to 4.0, and the site is working just fine (minus shared content - which in itself should be on the top of the lists as far as "what works" with a CMS system)
I would suggest Telerik make an emergency SP/build to fix this thing.
It is completely unuseable at the moment.
I would highly advise nobody take the 4.1 upgrade until the is fixed.
Hello Shawn and Scott,
Here is a code sample that will go through all controls on all pages you have in your site, and change their IDs to random generated GUIDs. This would save you the manual work you need to do. Please back up your database before performing this operation.
You can run the following in a static ASPX that you include in your site:
var manager = PageManager.GetManager();
var propName =
"ID"
;
var controls = manager.GetControls<PageControl>();
foreach
(var cb
in
controls)
var idProp = cb.Properties.FirstOrDefault(p => p.Name == propName);
if
(idProp ==
null
)
idProp = manager.CreateProperty();
idProp.Name = propName;
idProp.Value = Guid.NewGuid().ToString();
cb.Properties.Add(idProp);
var draftControls = manager.GetControls<PageDraftControl>();
foreach
(var cb
in
draftControls)
var idProp = cb.Properties.FirstOrDefault(p => p.Name == propName);
if
(idProp ==
null
)
idProp = manager.CreateProperty();
idProp.Name = propName;
idProp.Value = Guid.NewGuid().ToString();
cb.Properties.Add(idProp);
manager.SaveChanges();
Hi Slavo,
After executing your code, I still have the errors.
Could you please explain what can i do to solve this?
Regards,
Jocelyn
Hello Shawn Krivjansky,
There were indeed some problems with the code from my previous reply. Here's a new snippet:
var manager = PageManager.GetManager();
var propName =
"ID"
;
var controlCount = manager.GetControls<PageControl>().Count();
for
(
int
i = 0; i < controlCount; i += 100)
var controls = manager.GetControls<PageControl>().Skip(i).Take(100).ToList();
foreach
(var cb
in
controls)
var idProp = cb.Properties.FirstOrDefault(p => p.Name == propName);
if
(idProp ==
null
)
idProp = manager.CreateProperty();
idProp.Name = propName;
var newId =
"ControlPrefix"
+ Guid.NewGuid().ToString();
idProp.Value = newId.Replace(
'-'
,
'_'
);
cb.Properties.Add(idProp);
else
var newId =
"ControlPrefix"
+ Guid.NewGuid().ToString();
idProp.Value = newId.Replace(
'-'
,
'_'
);
manager.SaveChanges();
controlCount = manager.GetControls<PageDraftControl>().Count();
for
(
int
i = 0; i < controlCount; i += 100)
var draftControls = manager.GetControls<PageDraftControl>().Skip(i).Take(100).ToList();
foreach
(var cb
in
draftControls)
var idProp = cb.Properties.FirstOrDefault(p => p.Name == propName);
if
(idProp ==
null
)
idProp = manager.CreateProperty();
idProp.Name = propName;
var newId =
"ControlPrefix"
+ Guid.NewGuid().ToString();
idProp.Value = newId.Replace(
'-'
,
'_'
);
cb.Properties.Add(idProp);
else
var newId =
"ControlPrefix"
+ Guid.NewGuid().ToString();
idProp.Value = newId.Replace(
'-'
,
'_'
);
manager.SaveChanges();
Hi all,
We have posted a KB article for this issue, please refer to it for future updates:
http://www.sitefinity.com/devnet/kb/sitefinity-4-x/duplicate-control-ids-after-upgrading-to-sitefinity-4-1.aspx
The issue with Sitefinity assigning the same IDs for controls dropped from the toolbox is fixed for 4.1 SP1 and will not be a problem for future projects.