I get the error of this unexpected character, and I do not understand why.
var list = new List<MyModel>(); list.Add(new MyModel() { variable1 = 942, variable2 = 2001, variable3 = "my text", variable4 = 123 }); // CS1056 Unexpected character '' on this line
From what the error says and the actual error code that I received from the online compiler after copying / pasting, your code in this line contains a character that does not appear, but the compiler is trying to interpret. Just try to erase every character starting with your closing bracket to your number 3 and press Enter again. It should work (this works for me).
I just deleted the file Version=v4.0.AssemblyAttributes.cs(1,1,1,1)located in my temporary folder C:\Users\MyUser\AppData\Local\Tempand then it works fine.
Version=v4.0.AssemblyAttributes.cs(1,1,1,1)
C:\Users\MyUser\AppData\Local\Temp
.NET Core .NETCoreApp,Version=v2.1.AssemblyAttributes.cs
.NETCoreApp,Version=v2.1.AssemblyAttributes.cs
, .
. , (ASCII DLE, , -), . , notepad++ "View-> Symbol-> ". , , .
C:\Users\_\AppData\Local\Temp\ , , .
VS , .
Source: https://habr.com/ru/post/1599206/More articles:Why I limited myself to posting the NamedQuery annotation only for the entity class - javaAndroid application for the purchase order id GPA 123456789 - androidjava.lang.IllegalArgumentException: Named request not found. (Entity Manager does not create NamedQuery) - javaUsing the ActionMailer and Mandrill APIs to Send to Multiple Recipients - EmailWhy can I call instance functions statically? - c ++Can I test Swift applications on my iPhone with Xcode 6.4 and not have a developer license? - iosHow to put Ajax result (get data from server) in input tag? - ajaxconfuse these cookies in the redirect system - phpОбратное изображение кнопки не отображается после показа/скрытия SearchBar - iosHow to make this javascript in a loop? - javascriptAll Articles