Sujeet Raman

Sujeet Raman

  • 862
  • 927
  • 352.1k

CS1056 -Unexpected character "" What does it mean?

May 11 2021 1:18 PM
Hi,
 
I am creating a service in asp.net core api..while building my code i am getting this error
 
CS1056 -Unexpected character ""
 
when i declare string name = "projects/max78A"; i am getting this error
 
my code:
  1. using (var httpClient = new HttpClient())  
  2. {​​​​​​​  
  3. string name = "projects/max78A";  
  4. var content = "{​​​​​​​\"name\": \"" + name + "\"}​​​​​​​";  
  5. var stringContent = new StringContent(content, Encoding.UTF8, "text/plain");  
  6. Console.WriteLine("Sending Request: " + requestUri + stringContent);  
  7. HttpResponseMessage response = await httpClient.PostAsync(requestUri, stringContent).ConfigureAwait(false);  
  8. return await response.Content.ReadAsStringAsync();  
  9. }​​​​​​​  
i havent face this problem before please help me to understand what is the issue

Answers (4)