Upgrades Questions on upgrading to version 6.x.
Version 6.x > Upgrades > Compiler Error Message: CS0103: The name 'UrlHelper' does not exist in the current context View modes: 
User avatar
Member
Member
Chunda - 11/2/2011 4:35:17 PM
   
Compiler Error Message: CS0103: The name 'UrlHelper' does not exist in the current context
Hi,

Getting below error when trying to open home page after applying upgrade 5.5 R2 to 6.0. Any ideas as to the cause, or resoultion?

Thanks
Chunda
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: CS0103: The name 'UrlHelper' does not exist in the current context

Source Error:

Line 26: void CMSCustomTablesPage_Load(object sender, EventArgs e)
Line 27: {
Line 28: string domain = UrlHelper.GetCurrentDomain();
Line 29: if (domain != "")
Line 30: {

Source File: c:\inetpub\wwwroot\App_Code\CMSModules\CustomTables\CMSCustomTablesPage.cs Line: 28

User avatar
Member
Member
kentico_edwardh - 11/2/2011 8:45:27 PM
   
RE:Compiler Error Message: CS0103: The name 'UrlHelper' does not exist in the current context
Hello,

This file is not a part of the default installation in version 6.0, or any 5.x installs. This file is from version 4.1. It should be safe to remove this directory if you are not using any custom code within these files.

Best Regards,
Edward Hillard

User avatar
Member
Member
Chunda - 11/3/2011 2:54:07 AM
   
RE:Compiler Error Message: CS0103: The name 'UrlHelper' does not exist in the current context
Many thanks,

Must of missed it during the deletes when upgrading in the past.

Cheers
Chunda

User avatar
Member
Member
jobb-bana4 - 11/6/2011 9:18:37 AM
   
RE:Compiler Error Message: CS0103: The name 'UrlHelper' does not exist in the current context
Hi,
I had the exact same error but after deleting the file I got this instead:
CS0426: The type name 'MacroHandler' does not exist in the type 'CMS.GlobalHelper.MacroResolver'

App_Code\Global\CMS\CMSCustom.cs Line: 29
Any idea?

User avatar
Member
Member
Chunda - 11/7/2011 8:29:27 AM
   
RE:Compiler Error Message: CS0103: The name 'UrlHelper' does not exist in the current context
I would suspect you may have an old/wrong or customized version of that file. The line 29 of the upgraded file I have doesn't have a fererence to that name on it.

Is there a version with the .new extension in the same folder, the upgrade process detects files that are not as expected and doesn't replace it and leaves a .new version so any customizations can be merged manually.

Cheers
Chunda

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 11/16/2011 9:39:34 AM
   
RE:Compiler Error Message: CS0103: The name 'UrlHelper' does not exist in the current context
Hi,

That's most probably the case. I would here recommend to check our CTO's blogpost about customizations in v6 - devnet.kentico.com/Blogs/Martin-Hejtmanek/October-2011/Code-customization-in-Kentico-CMS-6.aspx - where the changes are mentioned, including info about Compatibility mode to run your customizations from 5.x versions.

Regards,
Zdenek

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 11/16/2011 9:35:43 AM
   
RE:Compiler Error Message: CS0103: The name 'UrlHelper' does not exist in the current context
Additionally, if your custom code contained usage of UrlHelper, please note that
the UrlHelper has been replaced - renamed to URLHelper because of collision with System.Web.Mvc.UrlHelper

Regards,
Zdenek