A core feature of Visual Studio that allows developers to inspect, analyze, and troubleshoot code during execution.
Visual Studio 2021 debugger doesn't work with dynamic type
I am using dynamic data type to create an object using inheritance of ExpandoObject and/or DynamicObject adding dynamically properties and fields. Everything seems to work, but I am not able to debug. When debugging (adding a watch, immediate or command window) a dynamic object created with
error CS1061: 'object' does not contain a definition for 'Hotels1' and no accessible extension method 'Hotels1' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?)
Even though when running the code it works fine
Console.WriteLine(entity.hotels2);
Console.WriteLine(entity.hotels2.id);
Console.WriteLine(entity.hotels2.name);
Console.WriteLine(entity.hotels30.name);
Console.WriteLine(entity.hotels32.name);
All these objects bring me correct information and the information is printed on console, everything works but debugger always bring me errors when using dynamic objects.
Developer technologies | Visual Studio | Debugging
Developer technologies | C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.