Thank you, I needed this to refactor something at work. Pd: Student programmers, for legacy code, don't refactor everything at once, make a plan and UML diagrams at least. The production code leave it as it is, and touch it little by little.
Thanks a lot! I was wondering for days what the purpose of [XmlAttribute] was, or other [ ]'s above variables or classes. It makes me wish there were more guides or tutorials on that online, or maybe I just haven't looked at the right places.
I get an error: An unhandled exception of type 'System.InvalidOperationException' occurred in System.Xml.dll Additional information: There was an error reflecting type 'RandomCircles.Annealing'. Any idea of what that means?
LeftTechticle Yes, it would be helpful if your example object contained a collection, or if you serialized a collection of these objects, and when would XmlWriter or XmlDocument be needed?
galt57 XmlWriter is for performant, custom XML generation (an implementation of this is typically not something to be directly consumed). XmlDocument is good for editing existing Xml files.
Hmm i keep getting this error "An exception of type 'System.UnauthorizedAccessException' occurred in mscorlib.dll but was not handled in user code" Where did I go wrong
Kofi Ghartey-tagoe Your probably trying to read a file that cannot be opened without administrative rights. Run your app as Administrator to confirm this.
How should I send it to you? its giving me this exception An exception of type 'System.InvalidOperationException' occurred in EntityFramework.dll but was not handled in user code Additional information: The model backing the 'NumberDBContext' context has changed since the database was created. Has me baffled
this stuff you've been talking about , were explained in 3 hours in a C# class while you did in 10 minutes school sucks lol
Why go to school, when you have internet :D
Brian, you have such a smooth voice built for teaching. Thank you so much
Thank you, I needed this to refactor something at work.
Pd: Student programmers, for legacy code, don't refactor everything at once, make a plan and UML diagrams at least.
The production code leave it as it is, and touch it little by little.
That was very helpful. Thank you very much! And your voice is sooo calming.
really well done. I wished the Microsoft docs were more crisp like that!
Thanks Brian, for helping me get sht done
Short and sweet. Thanks!
Thanks a lot! I was wondering for days what the purpose of [XmlAttribute] was, or other [ ]'s above variables or classes. It makes me wish there were more guides or tutorials on that online, or maybe I just haven't looked at the right places.
Great video. You help me a lot for xml.
very simple and quick tutorial, thank you! :D
Good as video
Thanks a lot! Nice mini-tutorial.
Very well explained. Thank you
Great video! Thank you
You rock!
Love it!
Thanks but, can you zoom in a little closer I can't see very well ;D
Thank you, this helped me alot.
I get an error:
An unhandled exception of type 'System.InvalidOperationException' occurred in System.Xml.dll
Additional information: There was an error reflecting type 'RandomCircles.Annealing'.
Any idea of what that means?
What if the variables are changing dynamically, how are we going to store the values ?
What IDE is this? How are you getting the 3 References notations above your methods and such?
VS Ultimate 2013
+Curtis .Smithson It is Resharper, you can see in the menu at 8:49
Yeah, but how often am I going to need to serialize one object? Usually I am going to need to serialize collections of objects.
Not often, considering your last sentence. Unless you find yourself writing data types that encompass the collections.
LeftTechticle
Yes, it would be helpful if your example object contained a collection, or if you serialized a collection of these objects, and when would XmlWriter or XmlDocument be needed?
galt57 XmlWriter is for performant, custom XML generation (an implementation of this is typically not something to be directly consumed). XmlDocument is good for editing existing Xml files.
@@galt57 List....
can u make a video on binary serialization
How can I append to an existing file?
what if we don't know xml tag?
good introduction.
Is this commonly used for saving things like games?
no xml is very useless, unless you code in html or work with a old project. json is the new way to go
Hmm i keep getting this error
"An exception of type 'System.UnauthorizedAccessException' occurred in mscorlib.dll but was not handled in user code"
Where did I go wrong
Kofi Ghartey-tagoe Your probably trying to read a file that cannot be opened without administrative rights. Run your app as Administrator to confirm this.
Is it possible that I send you my project and you help me understand a few things? Also to do with mvc
Kofi Ghartey-tagoe Yes it's possible
How should I send it to you? its giving me this exception
An exception of type 'System.InvalidOperationException' occurred in EntityFramework.dll but was not handled in user code
Additional information: The model backing the 'NumberDBContext' context has changed since the database was created.
Has me baffled
Kofi Ghartey-tagoe Upload it somewhere and send me the link
Hey whats up Brian
how could you do this to change a txt file to xml
follow the fucking lesson to understand ugh lol we cannot just put knowledge into your head you need to learn
I had to using System.IO. I use visual studio 2017
well you have to
{
new XmlSerializer(typeof(Class1)).Serialize(stream, this);
}
the less "var" there is in your code, the better :D
Brian we understand the logic you gave use by falsing you are not a male sorry lol
Here's some code that can be copied and pasted:
www.internetworkconsulting.net/articles/programming-xml-xml-serialization.aspx