error CS1056: Unexpected character '$' / XML Parsing Error: no root element found GetEmailBuilderC

kentico guy asked on February 19, 2020 15:56

I'm upgrading a bunch of instances of Kentico 8.2 to 12.0.15. One of these apps is having a couple different problems after the upgrade. There are two separate issues that are happening on the app (we also have different environments --instances of the app-- ranging from dev->production). One of the issues is an XML parsing error

XML Parsing Error: no root element found Location: http://helloKenticoWorld.com/CMSPages/Newsletters/GetEmailBuilderContent.ashx?issueid=622

The first thing I checked was another one of our apps where the email builder is working. I looked, and this file "GetEmailBuilderContent.ashx" does not exist on an instance of the app in which the email builder is working. If it does exist, it's not in the path listed above.

Has anyone seen this before?

The other issue is "Unexpected character '$'" in an aspx file

Here's the offending line of code: <%# PortalHelper.GetIconHtml(Eval<Guid>("EmailWidgetThumbnailGUID"), $"{Eval<string>("EmailWidgetIconCssClass") ?? "icon-cogwheel-square"} cms-icon-150", 32) %>

CMS\CMSModules\Newsletters\EmailBuilder\Email_Builder.aspx(38): error CS1056: Unexpected character '$' Exception type: System.Web.HttpCompileException Stack trace: at System.Web.Compilation.AssemblyBuilder.Compile() at System.Web.Compilation.BuildProvidersCompiler.PerformBuild() at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound) at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp) at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) at System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

I was told this is due to a missing .NET framework, but I just tested that theory, and I'm not so sure. I pointed the dev webapp to our production database and restarted the app. I was still getting the unexpected character exception when the dev box was running against the production database, which tells me it's not a code or installed framework pre-req issue. It must be some setting in the database that causes the unexpected character issue, because all I did to recreate the error was change the connection string. When I point the webapp back to the dev database, the unexpected character exception goes away but I get the XML parsing exception above.

So essentially, I get the unexpected character exception and once that's resolved then I'm getting the XML parser error.

Please advise things that I should check; thanks in advance!

Recent Answers


Juraj Ondrus answered on February 20, 2020 07:17

It is a .Net framework and C# issue. You just need to search for the error on Google:
Source 1
Source 2
Source 3
and there are many more. The syntax was added in C# v6.

Have you updated the target framework and/or NugetPackages of your project to the supported .Net version for given Kentico version? (sys. requirements) This looks like your project is using older .Net version and compiler while newer Kentico version is using features from newer C# version and .Net version.

0 votesVote for this answer Mark as a Correct answer

kentico guy answered on February 20, 2020 19:23

I have the project compiled in C# 7 (through attribute in the web.config) and also I have the codedom DotNetCompilerPlatform installed. I still don't see the email builder. Is there anything else I should check? I don't see the error now but I still don't see the builder.

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on February 21, 2020 07:31

Have you tried re-signing macros? I Assume you have the correct license key edition in place.

0 votesVote for this answer Mark as a Correct answer

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