cann't load assembly that cell type in

Posted by: chengjing-fp on 8 September 2017, 12:37 pm EST

  • Posted 8 September 2017, 12:37 pm EST

    hi scott:
      i write a custom cell type emfCellType like this:
    EmfCellType : FarPoint.Win.Spread.CellType.ImageCellType ;
    then i save a spread with a cell of emfCellType to xml file;
    and later i edit my code and dll's verision (this project is a strong named dll), but when i load previous xml file, system throw a exception like this " cann't load assembly LinkinTec.Common.UI.Spread, Version=1.0.2698.37257, Culture=neutral, PublicKeyToken=xxxxxx",how can i resolve this problem?

  • Replied 8 September 2017, 12:38 pm EST

    Hello,


    I believe the serializer only links the version of an Assembly when using binary serialization. You can try saving this as ASCII instead.

  • Replied 8 September 2017, 12:38 pm EST

    hi scotts:
      i save my spread to xml file and i found
    "             
     "
    in xml file. when i modify "
    LinkinTec.Common.UI.Spread" prpoject, it's publicKeyToken will change to another value. so i don't like to save this celltype in my xml file, how can i do?

  • Replied 8 September 2017, 12:38 pm EST

    Hello,


    If you do not want to write out the CellType when serializing the Spread, you can override the Serialize method in the CellType class and not write out anything.

  • Replied 8 September 2017, 12:38 pm EST

    hi:
      i overwrite the serialize method like this :

     "public override bool Serialize(System.Xml.XmlTextWriter w)
            {
                return true;
            }"
    but i found the content still in the xml file,

      ""

  • Replied 8 September 2017, 12:38 pm EST

    Hello,


    You would need to set up a binding redirect for your dll in the version of the framework you are using to load the correct version of the assembly.

  • Replied 8 September 2017, 12:38 pm EST

    hi scotts:
      i mean i don't want to  bind this cell type to a special version.  how can i do?
  • Replied 8 September 2017, 12:38 pm EST

    Hello,


    I would suggest calling the ResetCellType method before saving the Spread. Then, the celltype will not be exported to XML. Then you can reset the celltype back to your custom class after the save.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels