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."...
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...
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...
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; }...
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...
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 =...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.