Solved

.Net Serialization change the class name without breaking saved files

Posted on 2014-03-05
6
285 Views
Last Modified: 2014-03-05
hi
I have app with class called say "MyClass"
I want to change it to say "MyClass123"
Problem is that there are saved files that are serialized to have "MyClass"
How do I handle this - I want to rename class but still all files to open

Thanks
0
Comment
Question by:rwallacej
  • 3
  • 2
6 Comments
 
LVL 83

Expert Comment

by:CodeCruiser
Comment Utility
Creating a new class instead of renaming would be one option.
0
 

Author Comment

by:rwallacej
Comment Utility
the saved files will have lots of
<MyClass> items

so
<MyClass123> won't be found

I need to rename class to MyClass123 BUT still be able to read serialized files with <MyClass>  
(I don't mind if the serialized files have <MyClass> in them and not newer MyClass123

reason...the original class name wasn't good / clear so want to change it
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 250 total points
Comment Utility
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 6

Assisted Solution

by:Tony O'Byrne
Tony O'Byrne earned 250 total points
Comment Utility
The MSDN also gives examples of serializing with a specified filename.  Being able to specify the filename explicitly like this would mean you can change things as much as you want later down the road.

http://msdn.microsoft.com/en-us/library/58a18dwa(v=vs.110).aspx
0
 

Author Comment

by:rwallacej
Comment Utility
tried

    <XmlRoot(ElementName:="xxx")> _

and

    <XmlRoot("xxx")> _

but this didn't work.
the saved files still have the class name / Filename - they don't have the <xxx> specified
0
 

Author Comment

by:rwallacej
Comment Utility
got it thanks, I was mixing variable names and class names
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now