Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2017 Unexpected Character '

So I had 2 weird system crashes, shall I say restarts. I tried to troubleshoot but i could't find any problem. Soon after I went into VS 2017 to practice a bit and this occurs.

Error:

C:\Users\Shaky\App Data\Local\Temp.NET Framework,Version=v 4 . 5 . 2 . Assembly Attributes.cs(1,1,1,1): error CS 1056: Unexpected character '

Note that it doesn't say which character, it just says " ' ".

And this repeats over and over like 202 times.

I had to separate framework version numbers with space because it doesn't let me pass the file path due to bad grammar, I searched how to do it, didn't find, this is my first time posting i think.

And this repeats over and over like 202 times.

like image 964
Sha Kal Avatar asked Jul 12 '17 11:07

Sha Kal


2 Answers

As per https://lautzofdotnet.wordpress.com/tag/unexpected-character/ you need to do the following:

Browse to the file in question in the Appdata\temp folder and you’ll see at at least the file in question (my case .NETFramework,Version=4.5.2.AssemblyAttributes.cs). I also had a few other similar files for different .NET versions.

Just delete them out of the temp folder. When you recompile, they will get recreated, but I received no errors and all is working well.

Note: The file can usually be found in C:\Users\\{userName}\AppData\Local\Temp

like image 87
mjwills Avatar answered Sep 17 '22 19:09

mjwills


This will also fix the problem if anyone encounters it in Xamarin forms for Android, delete the respective file (Example:"MonoAndroid,Version=v7.1.AssemblyAttributes.cs ") out of the temp folder

like image 40
Ionut Radu Avatar answered Sep 20 '22 19:09

Ionut Radu