Kentico 11 Upgrade

Jason Bertram asked on December 12, 2017 19:50

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: CS1056: Unexpected character '$'

Correct Answer

Jason Bertram answered on December 13, 2017 01:09

The problem was that I did not do the following step. The site was going step-by-step all the way from version 8.2 to 11. If I understand correctly a new version 10 install doesn't need this. Hopefully this helps someone else.

Below was taken from the Kentico 11 upgrade doc:

Required .NET Compiler Platform

Kentico 11 requires the .NET Compiler Platform ("Roslyn") compiler to run. Installations of Kentico 10 or newer contain the Microsoft.CodeDom.Providers.DotNetCompilerPlatform NuGet package by default, which provides the required functionality.

However, if your project is upgraded from Kentico 9 or older, you may be missing the package. In these cases, you need to install the package before applying the upgrade:

Open your Kentico solution in Visual Studio. Right-click the main web project in the Solution Explorer and select Manage NuGet Packages. Install the Microsoft.CodeDom.Providers.DotNetCompilerPlatform NuGet package (version 1.0.2 or newer).

2 votesVote for this answer Unmark Correct answer

Recent Answers


Trevor Fayas answered on December 12, 2017 19:58

Can you provide a little more information?

Like what actual file gave this error? did you look at the Line 274 of that? etc.

0 votesVote for this answer Mark as a Correct answer

Jason Bertram answered on December 12, 2017 20:08

Source Error:

Line 274: private void HandleContentCheckBox(List

0 votesVote for this answer Mark as a Correct answer

Jason Bertram answered on December 12, 2017 20:09

Source File: c:\CMS Projects_K10Upgrades_Free\K10Upgrades_sites\K10Upgrades_sites\backwatergamblersnew.com\httpdocs\CMS\App_Code\CMSModules\Content\Extenders\ContentEditTabsControlExtender.cs Line: 276

0 votesVote for this answer Mark as a Correct answer

Jason Bertram answered on December 12, 2017 20:12

Here is the error. It was being stripped because of the tags.

Source Error:

Line 274: private void HandleContentCheckBox(List<UITabItem> items)

Line 275: {

Line 276: var script = $@"

Line 277:var IsCMSDesk = true;

Line 278:function ShowContent(show) {{

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on December 12, 2017 20:12 (last edited on December 12, 2017 20:12)

I'd suggest getting a hold of Kentico Support vs. posting on the Q&A mainly because Kentico 11 was just released yesterday and this could very well be a bug and Support doesn't monitor the Q & A's, not to mention your post is very vague.

0 votesVote for this answer Mark as a Correct answer

Trevor Fayas answered on December 12, 2017 20:14 (last edited on December 12, 2017 20:15)

Considering the V10 looks like the below, i would see if for some reason "String.Format(" got replaced with "$" for that page.

private void HandleContentCheckBox(List<UITabItem> items)
    {
        var script = String.Format(
@"var IsCMSDesk = true;
function ShowContent(show) {{
    document.getElementById('{0}').style.display = show ? 'block' : 'none';
}}", pnlContent.ClientID);

        ScriptHelper.RegisterClientScriptBlock(Control.Page, typeof(string), "UserInterfaceEditTabsControlExtender", ScriptHelper.GetScript(script));

        UpdateTabs(items);
    }
0 votesVote for this answer Mark as a Correct answer

Suneel Jhangiani answered on December 12, 2017 23:11

The error might be due to the compiler version being use since newer versions of c# support in place variables using the $ to prefix the string and then placing variables in curly brackets. ie.:

var date = DateTime.Now;
var dateString = $"The current date and time is {date}";
0 votesVote for this answer Mark as a Correct answer

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