Personalized Community is here!
Quickly customize your community to find the content you seek.
Have questions on moving to the cloud? Visit the Dynamics 365 Migration Community today! Microsoft’s extensive network of Dynamics AX and Dynamics CRM experts can help.
2021 Release Wave 2Discover the latest updates and new features releasing from October 2021 through March 2022.
2021 release wave 2 plan
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Community | FastTrack Program | Finance and Operations TechTalks | Customer Engagement TechTalks | Upcoming TechTalks | All TechTalks
Sometimes when integrating between external systems or reading XML from I/O, you might need to deserialize that XML string into a runtime object. Because converting an XML into an object will give lots benefits rather than parsing the XML and then extracting/manipulating nodes.
Luckily, in Visual Studio 2013 there is a new feature that can create a class with its properties on behalf of you according to the passed XML string. So rather than manually writing a class with lots of properties to map your XML structure, Visual Studio 2013 does it for you.
Here is a simple XML sample:
>Hide your heart
Open a new instance of Visual Studio 2013, create a new C# Project select Console Application.
Change the Target framework to .Net 4.5, this is really important, because this feature only works .Net 4.5 projects.
Add a new Class to the project by right-click the project and go to Add and then select Class.
Keep the existing class name because it will automatically change as we will see now.
Completely remove this code from the Class file and place your cursor between the namespace curly braces like this:
Now from the main menu, go to Edit > Paste Special > Click Paste XML as Class.
And Voila, you have a C# class that represents your pasted XML string. Now you can deserialize your XML strings into memory using an instance of your class.
This feature also applies for JSON and it works if you have Visual Studio 2012 Update 2.
Business Applications communities