Blog Document Type, CMS Repeater, and Transformation not working

Donald Horne asked on January 21, 2015 14:53

We have custom ASPX templates on our site and afeter I upgraded the Development site, I also updated all custome code errors. Then, I built the solution using VS 2013 and all seems to be alomost ok except for on of our pages that uses the CMSRepeater and Document type transformations (Blog) to present all those Blog posts that are published. I have re-signed Macros and checked the Event logs and nothing points out. The curious thing is that the Blog post page works and it seems to be using more or less the same code. The only difference is the transformation is using. If code is needed I can post it.

Correct Answer

Brenden Kehren answered on January 21, 2015 21:42

Looks like you need to change directory to the path you have the CodeUpgradeTool in. Right now it looks like you have the CodeUpgradeTool in the root of C:\, is that right? Works best if you run the CMD prompt as administrator.

0 votesVote for this answer Unmark Correct answer

Recent Answers


Brenden Kehren answered on January 21, 2015 15:16

Did you follow the instructions on upgrading from v7 -> v8? Did you run the code analysis and check out all the virtual object (layouts, transformations, etc.) to the file system when analyzing? This should give you a pretty good idea on what you will need to change after you run the upgrade tool.

Typically the transformation has code in it that is obselete. What I do is get the site in a running order and check out all the virtual objects again to the file system. Then I build the project in Visual Studio and see if the transformations build as expected. This is typically when you'll find several references to CMSContext which need to be replaced with the new Context classes (SiteContext, DocumentContext, MembershipContext, etc.)

0 votesVote for this answer Mark as a Correct answer

Donald Horne answered on January 21, 2015 15:35

Hello Brenden,

Thanks for the quick response. I did follow all the instructions for upgrading from 7.0 to 8.0 (I even printed them). However, the Kentico Code Upgrade tool failed to work (and yes I matched all the Prerequisites). I kept getting and error stating that the path format to the solution was not supported (I also opened a support ticket for this one). I will try checking out the virtual objects and re-compile and see if I can manually correct any errors. It would be nice if I can make this upgrade tool work (for QA and PROD environments).

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on January 21, 2015 16:52

I've found the Code Upgrade tool to be a little picky when it comes to placement of the .sln file. This needs to be in the root of the website. Also, if you have added any <location> nodes in your web.config, comment them out.

Also, make sure your .sln file has the correct properties set (open it with notepad). For instance I've found that the line defining your website will have an incorrect entry in it like so:

Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "KenticoSite", "http://localhost", "{D329D90B-F2B2-4B0C-9AA4-8F3A30333CC3}"

This will need to be changed to (replacing the URL):

Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "KenticoSite", "KenticoSite\", "{D329D90B-F2B2-4B0C-9AA4-8F3A30333CC3}"

Of course you'll have to modify the path as well with moving the .sln file.

0 votesVote for this answer Mark as a Correct answer

Donald Horne answered on January 21, 2015 21:36

Made the necesary changes and now I am getting the following:

Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved.

F:>c:

C:>CodeUpgrade.exe C:\inetpub\wwwroot\Haskell.com\WebSite.sln

Unhandled Exception: System.UriFormatException: Invalid URI: A Dos path must be rooted, for example, 'c:\'. at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind) at System.Uri..ctor(String uriString, UriKind uriKind) at System.Xml.XmlResolver.ResolveUri(Uri baseUri, String relativeUri) at System.Xml.XmlUrlResolver.ResolveUri(Uri baseUri, String relativeUri) at System.Xml.XmlTextReaderImpl..ctor(String uriStr, XmlReaderSettings settin gs, XmlParserContext context, XmlResolver uriResolver) at System.Xml.XmlReaderSettings.CreateReader(String inputUri, XmlParserContex t inputContext) at System.Xml.XmlReader.Create(String inputUri, XmlReaderSettings settings, X mlParserContext inputContext) at System.Xml.Linq.XDocument.Load(String uri, LoadOptions options) at Kentico.CodeUpgrade.Issues.IssueLoader.LoadAllIssuesFromFile(String xmlFil ePath) at Kentico.CodeUpgrade.ZipImport.GetIssues() at Kentico.CodeUpgrade.Sandbox.Program.GetIssues() at Kentico.CodeUpgrade.Sandbox.Program.Main(String[] args)

C:>c:

0 votesVote for this answer Mark as a Correct answer

Donald Horne answered on January 21, 2015 21:42

An this is the solution file (text):

Microsoft Visual Studio Solution File, Format Version 12.00

Visual Web Developer Express 2010

Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "localhost", "C:\inetpub\wwwroot\Haskell.com\WebSite.sln", "{99C31205-EC0E-4304-856D-93525DD63DB0}" ProjectSection(WebsiteProperties) = preProject UseIISExpress = "true" TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.0" Debug.AspNetCompiler.VirtualPath = "/Haskell.com" Debug.AspNetCompiler.PhysicalPath = "..\Haskell.com\" Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\Haskell.com\" Debug.AspNetCompiler.Updateable = "true" Debug.AspNetCompiler.ForceOverwrite = "true" Debug.AspNetCompiler.FixedNames = "false" Debug.AspNetCompiler.Debug = "True" Release.AspNetCompiler.VirtualPath = "/Haskell.com" Release.AspNetCompiler.PhysicalPath = "..\Haskell.com\" Release.AspNetCompiler.TargetPath = "PrecompiledWeb\Haskell.com\" Release.AspNetCompiler.Updateable = "true" Release.AspNetCompiler.ForceOverwrite = "true" Release.AspNetCompiler.FixedNames = "false" Release.AspNetCompiler.Debug = "False" SlnRelativePath = "..\Haskell.com\" StartServerOnDebug = "true" EndProjectSection EndProject

0 votesVote for this answer Mark as a Correct answer

Donald Horne answered on January 21, 2015 21:53

That worked, I move all the solution files under the CodeUpgrade directory and modified the Solution file (as text) as you explained previously and it is running now.

Thanks for your help.

0 votesVote for this answer Mark as a Correct answer

Donald Horne answered on January 22, 2015 14:43

After I ran the analysis, the issues.csv file refelcts over 2000 files need change. However, when I compile my application, I only get errors pointing to the CMSVirtualFiles directory (of course). The funny thing is that the CodeUpgrade.exe never reports issues in this CMSVirtualFiles directory. This upgrade from 7.0.37 to 8.0 has become more time com=nsuming than we expected. Not sure what else to do.

Thanks for your help though.

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on January 22, 2015 14:57

The code upgrade tool is to be used for informational purposes even though it can "automatically" fix some of the reported issues. When you run the upgrade the majority (roughly 75%) of those 2000+ changes will be handled.

What I do is:
1. run the tool,
2. check the virtual objects back in,
3. take backup of the database and code,
4. run the upgrade (via KIM),
5. build the site,
6. fix errors to get site to a point where it will run and I can access Admin, 7. take a backup of the database and code 8. access Admin and checkout virtual objects,
9. build the site,
10. fix the errors,
11. check virtual objects back in,
12. run the site
13. take a backup of the database and code

Since there are a lot of API changes from 7 -> 8 this is needed. The instructions also mention the virtual objects won't be updated which is why all the checking in and out should happen.

It is a lot of work but if you don't have custom code or very little, it should take a short amount of time. I've got a site that's got a lot of custom code and is in ASPX (vs. portal) and have spent about 24 hours to upgrade from 6 -> 8.2 and still have a little time left.

0 votesVote for this answer Mark as a Correct answer

Donald Horne answered on January 22, 2015 19:20

Thanks for all your help.

0 votesVote for this answer Mark as a Correct answer

Donald Horne answered on January 22, 2015 21:37

Hi Brenden,

Sorry to bother so much but I can't find a way to make this Blog page work again (it is working on my QA and Prod environments no upgrade yet). I have followed all your steps, compiled the solution successfully, imported the virtual objects back to database but this page still does not want to work. I re-created the page and same result...nothing comes up on the repeater. Is there something different we need to do (i.e. call DataBind() or something) in code to make the repeater work?

Thanks.

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on January 22, 2015 21:49 (last edited on January 22, 2015 21:49)

I'd take a look at the event log and the transformations for those specific pages, I'm guessing there was something missed in the transformation for one of them. Could also be part of a page template or a layout as well.

0 votesVote for this answer Mark as a Correct answer

Donald Horne answered on January 22, 2015 21:54

I found the issue....in 8.0 the CMSRepeater seems to be expecting the Path property to be set. So, I added "Path="/Resources/%" and all starting showing up... thanks again for all your time.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.