locked
SerializationException: Type is not resolved for member ... RRS feed

  • Question

  • Hi,

    I'm currently at loss with this current problem. This is the scenario: I have several c# libraries (all strongly named) in my solution. This solution processes data and serialised the result into a MS SQL Server database.

    From my VSTO project (using VB.NET) I tried to access the database and deserialise the result back into my object. Everything works until the moment of deserialisation where I get the SerializationException: Type is not resolved for member ...

    I have a test project that accesses the database and deserialise my object and it is working perfectly fine, so I'm certain that the serialisation/deserialisation code is working, but just not within VSTO framework.

    Any ideas?

    Cheers,

    Victor

    Monday, February 5, 2007 4:05 PM

Answers

  • Well for everyone benefit I found what the problem was. Turned out if .NET is hosted by an external process (ie: Excel) it often fails to load referenced assemblies. I had to reference the assemblies manually on the project reference and this problem is gone.

    To find out which Assemblies .NET is trying to load you need to hook into the AssemblyResolve event of the current app domain. The error message is a red-herring thus sent me to a wild goose chase for a good part of the day.

     

    Tuesday, February 6, 2007 9:46 AM