Search code examples
c#.netvisual-studio-2012visual-studio-debugging

Strange symbol in VS debugger and missing method exception


My setup is like this:

  • Domain Model project => Contains my entities. Shared with both server and client app.

  • Server/webservices => MVC WebAPI and data is returned as JSON, uses Json.Net library.

  • Client => C# Winforms app, data is retrieved using RestSharp and Json.Net libraries.

Having stated my setup, I want to state that my setup is working, no problem until some recent changes.

I've added some new properties to one of my entities (Domain Model project), modified my webservices to make use of changes performed, and re-launched. Ok, it worked, and returned JSON also tell me that new fields are being handled corrctly.

So far so good. Now, the client part. I've debugged received JSON from server, and new data (with new properties) is fine. however, when Json.Net tries to parse data into entities, only a few properties show up. And when I try to populate my data with data, I get MissingMethodException:

{"Method not found: 'System.String Domain.Equipment.get_Weight()'."}

Weight is indeed one of my recent changes, but code does compile.

I've tried building, Rebuilding, removing and adding reference to my Domain Model project, Building and Rebuilding again, and I still get the same exception error.

I've noticed, however, a strange VS icon while debugging, as shown:

strange icon

I'm fairly new to VS2012, so It may be something trivial. Any idea about that icon? Or why this may happening?

For further explanation, leave a comment and I'll edit.


Solution

  • That strange blue icon indicates the property is protected. You get a stop symbol if the property is private. These icons differ from the smaller ones that appear in the variable Windows (padlock for private, star for protected).

    You can see a list of the icons here: http://msdn.microsoft.com/en-us/library/y47ychfe.aspx

    Although that list doesn't container the larger icons that appear when you hover over variables, such as the blue icon you have screenshotted. I actually wonder if the different icons are a bug in visual studio. It would seem to make more sense to use the same icons for the variable windows and the context/treeviews.

    If you are getting a MissingMethodException then it really means you are calling an old version of the assembly. Have you GACed the assembly? Perhaps an older version is in the GAC and it's picking that up.

    You could also try recycling or rebooting in case anything has cached stuff (eg IIS)