jasonh
jasonh

Reputation: 30303

How do I change and/or move a class that has been serialized?

I've got a class in my project and I want to move and rename that class to somewhere else in the project's namespace. I tried simply moving it, but then the program won't deserialize any settings saved under Properties.Settings.Default for that setting. Is there a way I can move it without losing all of the user's settings?

Upvotes: 1

Views: 162

Answers (2)

GvS
GvS

Reputation: 52528

I think the SerializationBinder contains a solution for your problem.

From the MSDN documentation:

Some users need to control which class to load, either because the class has moved between assemblies or a different version of the class is required on the server and client.

Upvotes: 1

Reputation:

I'll assume your using Studio, have you tried dragging the class into a Class Diagram and renaming from there? I find that Studio refactors accordingly from the Class Diagram.

Upvotes: 0

Related Questions