Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

.Net Serialization change the class name without breaking saved files

Posted on 2014-03-05
6
Medium Priority
?
305 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 83

Expert Comment

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

Author Comment

by:rwallacej
ID: 39906748
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 1000 total points
ID: 39906784
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 6

Assisted Solution

by:Tony O'Byrne
Tony O'Byrne earned 1000 total points
ID: 39907190
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
ID: 39907325
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
ID: 39907396
got it thanks, I was mixing variable names and class names
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
Create a Windows 10 custom Image with custom task bar and custom start menu using XML for deployment.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

609 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