I think that the namespaces of the two projects differ, so this is why it isn’t working.
Try making a dynamic link library which contains that class, and use the same library in both projects. This way, you can also modify the class in one project, it will be modified automatically in the second project.
How to create a dynamic link library:
- Open the new project window in Visual Studio
- Select the project type Class Library
- Make sure the project is added to the current solution, and accept
- Add your classes in the newly created project, make sure they are
public
- Add a reference to the library project in all other projects.
5
solved C# Deserialization Error [closed]