Error CS1056: Unexpected character '$'

Ranorex Studio, Spy, Recorder, and Driver.
Posts: 12
Joined: Thu Mar 03, 2022 8:58 am

Error CS1056: Unexpected character '$'

Post by Taz » Tue Feb 21, 2023 2:25 pm

I used Ranorex for a while but today I suddenly get the following Errors when compiling:
Error CS1056: Unexpected character '$'

This is on each line of code where string interpolation is used ($"some text")

Anybody any idea what causes it and how to fix it?


Posts: 151
Joined: Thu Aug 11, 2022 8:55 pm

Re: Error CS1056: Unexpected character '$'

Post by IvanF » Tue Feb 21, 2023 9:47 pm

Have you recently changed versions of Studio, .NET framework, etc.?

CS1056 looks like a C# error (not specific to Ranorex) due to compiler version mismatch. One of the recommendations is to install an additional package - ... ntinuous-i (which is marked as deprecated, and Microsoft.Net.Compilers.Toolset is recommended instead. Both are available through package management inside Studio).