Sam Bunting
Sam Bunting

Reputation: 965

Strange name and value appearing in Watch window

Does anyone have any idea what this means in the Watch window, how it was caused and how I could fix it?

I can't seem to find a specific line of code which is breaking it, it appears before the constructor of a class. I don't know what is causing it. I am programming in C# using Visual Studio 2015.

Has anyone else had an issue of this before?

enter image description here

A non-image version of the output is:

此᫈暔熚攺ᙋᲰ耀㼴͹픑㨊攼ᙉᵬ耀 error CS0726: '᫈暔熚攺ᙋᲰ耀㼴͹픑㨊攼ᙉᵬ耀' is not a valid format specifier

I'm not great at languages, but it appears to be a mixture of Chinese, Korean and various unicode characters. All of my code is written in English.

EDIT After further investigation, changing the text value or deleting it will make it not reaper when stepping through the code (Until it hits an exception in my code), or relaunching the debugger.

Upvotes: 0

Views: 2664

Answers (2)

PaulF
PaulF

Reputation: 6773

This is the Watch window - it contains a list of variables you specifically want to watch while debugging. It is not related in any way to a line of code. When you hit a break point, you can enter any value at all in the Name column - if it matches a variable that is currently in scope the value column will show its current value otherwise an error saying it is not in scope.

The names are saved somewhere so they persist when VS is restarted, so it is possible it is due to corruption of that file or if you cut & paste from somewhere using an unexpected character set.

The Name column must be a valid variable name (no spaces) or an expression (spaces allowed but it must be a valid expression) - anything after the valid portion of input may be considered as a format specifier (for example to limit number of array elements) - this error is related to that.

You can simply delete this entry & it will be gone permanently. There is no problem with your code.

Upvotes: 1

Abinash
Abinash

Reputation: 481

Compiler Error CS0726

Visual Studio 2008 Other Versions 'format specifier' is not a valid format specifier This error occurs in the debugger. When you type a variable name into one of the debugger windows, you can follow it with a comma, and then a format specifier. Examples are: myInt, h or myString,nq. This error arises when the compiler does not recognize the Format Specifiers in C#.

Check your VS language :

  1. On the Tools menu, click Options.
  2. In the Options dialog box, expand Environment and then click International Settings.
  3. In the Language list, choose the language in which the UI text should appear in the development environment.

Upvotes: 0

Related Questions