Search results for query: *

  1. M

    How to get the exact location of an exception in C#, as can be done in VB.net?

    Ok ... we have the solution. You can run the compiler optimized, then run the Dotfuscator, and still get the exact error line number reported by the System.Exception Class. And ... there are no PDB files to help hackers crack your software. Just set Debugging information to "Embedded."...
  2. M

    How to get the exact location of an exception in C#, as can be done in VB.net?

    The test system: -Windows 10 -VS2022 -C# -.Net Framework 4.8 -WinForms What I'm Trying to Accomplish: We are trying to build an error reporting system in C# that will give the exact line number that throws an exception. It needs to work with the compiled release .exe file. It is easy to do...
  3. M

    How to create a blank class object that receives data of changing structure?

    Yes ... but I really appreciate the help you've provided. Your answers helped me to figure everything out.
  4. M

    How to create a blank class object that receives data of changing structure?

    Sorry for not giving more explanation. The API JSON data will change between 6 set options, and it is easy to programmatically determine which of those options it is. I didn't want to get into the details of that, because that was not what I was having difficulty with. I had been coding all...
  5. M

    How to create a blank class object that receives data of changing structure?

    Thank you for your patient responses. Using your answers and the help of others, I was able to structure the program the way that I had planned: public class Foo { public string JsonString { get; set; } public dynamic MyObject { get; set; } public string MyString1 { get; set; }...
  6. M

    How to create a blank class object that receives data of changing structure?

    The indexing is included in the JSON data. For example: string JsonData = "{number:1000, str:'string', array: [1,2,3,4,5,6]}"
  7. M

    How to create a blank class object that receives data of changing structure?

    Hi: Thanks for your reply. I've edited my original post to not misuse the word "variant". I've tried using "ExpandoObject": dynamic MyObject = new System.Dynamic.ExpandoObject(); MyObject = JsonConvert.DeserializeObject<dynamic>(body.JsonData); When I run this, I get a runtime error...
  8. M

    How to create a blank class object that receives data of changing structure?

    Hello: I'm downloading APIs and deserializing their JSON content into an object. The JSON structure varies dramatically from day to day. It also has arrays[] of information. So I need an object that can accept varying data structures. This works: var MyObject =...
Back
Top Bottom