.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Problem when doing a binary serialization from COM

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :WPF


I am trying to serialize an object using binary and I'm running into an error "Unable to load assembly". I tried creating a new SerializationBinder which loads the correct assembly however it returns an error "The object with ID 7 was referenced in a fixup but does not exist" (I also received the same error but with ID 6).

My code runs in the following way:

A COM visible dll is launched from a VB6 application. This DLL has a reference to a .NET dll which contains the data objects and performs the serialization.

However, If add a new Windows Forms application to the solution, and call the same methods using the same data objects deserialization works without any issues, and no need to reset the binding.

Thank you

View Complete Post

More Related Resource Links

Cutting Edge: Binary Serialization of DataSets


The ADO. NET DataSet object plays an essential role in most of today's distributed, multitiered applications. Instances of the DataSet class are used to move data across the tiers and to exchange data with external services.

Dino Esposito

MSDN Magazine October 2004

Cutting Edge: Binary Serialization of ADO.NET Objects


One of the key elements that makes ADO. NET superior to ADO is the level of integration with XML. In ADO, XML is just an I/O format. In addition, the ADO XML format is totally inflexible and doesn't allow any type of customization.

Dino Esposito

MSDN Magazine December 2002

Is this an example of binary serialization


Hi , I have write this code for write error message in .txt file and this code is working fine.

void writeToLogFile(string logMessage)


        string strLogMessage = string.Empty;

        string strLogFile = System.Configuration.ConfigurationManager.AppSettings["logFilePath"].ToString();

        StreamWriter swLog;

        strLogMessage = string.Format("{0}: {1}", DateTime.Now, logMessage);

        if (!File.Exists(strLogFile))


            swLog = new StreamWriter(strLogFile);




            swLog = File.AppendText(strLogFile);






I want to know is this an example of binary serialization? 
If YES then please inform me from which line the serialization is done? 
If NO then please tell me an example of Binary Serialization ?

Problem with passing an Image as binary through web service



I have a web service that is accessed by a windows forms application and receives updates like facility name, address, image etc. Everything works fine except the image data is not being passed to the windows app. I am saving the images in database on both sides, so when I pull it from the server I use the following code

if (!reader.IsDBNull(floorPlanOrdinal))

facility.FloorPlan = (byte[])reader["FloorPlan"];

I can see the facility.FloorPlan Dimentions as 103840 when I debug this method which means that the data is pulled from the database fine.

On the forms side though the dimentions become 0, all other values pass fine except this. Here is the facility property in the web service on server side.

using System;

using System

Serialization and generics : problem with xmlinclude

Hello everyone. I've got a hierarchy of class like this: [Serializable] [xmlinclude(DiscreteDomain)] public abstract class Domain { } [Serializable] [xmlinclude(DiscreteDomain<>)] public abstract class DiscreteDomain : Domain { } [Serializable] public sealed class DiscreteDomain<T> : DiscreteDomain { } I can't serialize an object of type DiscreteDomain<T> because xmlinclude can't be used with a generics like DiscreteDomain<> (a type must be specified but i can't).   How can I serialize this type of object ?   Thx, JP

Problem importing text files with binary zeros (0x00) via SSIS(SQL2005). It is all fine when using D

Hi.   There is a "text" file generated by mainframe and it has to be uploaded to SQL Server. I've reproduced the situation with smaller sample. Let the file look like following: A17     123.17  first row          BB29    493.19  second             ZZ3     18947.1 third row is longer And in hex format: 00:  41 31 37 20 20 20 20 20 ? 31 32 33 2E 31 37 20 20  A17     123.17  10:  66 69 72 73 74 20 72 6F ? 77 0D 0A 42 42 32 39 20  first row??BB29 20:  20 00 20 34 39 33 2E 31 ? 39 20 20 73 65 63 6F 6E     493.19  secon30:  64 0D 0A 5A 5A 33 20 20 ? 20 20 20 31 38 39 34 37  d??ZZ3     1894740:  2E 31 20 74 68 69 72 64 ? 20 72 6F 77 00 69 73 20  .1 third row is 50:  6C 6F 6E 67 65 72       ?                          longer          I wrote "text" in quotes because sctrictly it is not pure text file - non-text binary zeros (0x00) happen sometimes instead of spaces (0x20).   The table is: CREATE TABLE eng ( src varchar (512) )   When i upload this file into SQL2000 using DTS or Import wizard, the table contains: select src, substring(src,9,8), len(src) from eng <               src                ><substr>             <len> A17     123.17  first row           123.17                  25BB29                                493.19                  22ZZ3     18947.1 third row           18947.1                 35   As one can see, everything was importe

Binary Data Problem....save and retrive image data from sql database


hello friends...please help me to solve this problem....

i have created crud (create, retive, update and delete)form and it's running... here i want to add images for each record(sql database)....

i'm using image datatype in sql table for picture.....

Q 1: how to save and retrive binary data(image) from sql table in asp.net form using vb coding?

Q2: can i create sql table which store binary(image url) data direct?

thank you

Problem with serialization of objects

When I try to return a collection (an List<>) of a complex kind of object (each one have about 20-30 custom objects inside) I get this error:

Test method SMILTest.ServiceManagerTest.PessoasTest threw exception:  System.ServiceModel.CommunicationObjectFaultedException: The communication object, System.ServiceModel.Security.SecuritySessionClientSettings`1+ClientSecurityDuplexSessionChannel[System.ServiceModel.Channels.IDuplexSessionChannel], cannot be used for communication because it is in the Faulted state..

Server stack trace:
   at System.ServiceModel.Channels.CommunicationObject.ThrowIfFaulted()
   at System.ServiceModel.Security.SecuritySessionClientSettings`1.ClientSecurityDuplexSessionChannel.TryReceive(TimeSpan timeout, Message& message)
   at System.ServiceModel.Dispatcher.DuplexChannelBinder.Request(Message message, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Obje

XAML Serialization Problem


I try to save (serialize) a XAML document. The background is that the user of the application should be able to change the XAML document dynamically.

This works fine with some basic controls but as soon as I have a datagrid inside the XAML, non of this works:

System.Windows.Markup.XamlWriter.Save throws:

Cannot serialize a generic type 'System.Collections.ObjectModel.ObservableCollection`1[Microsoft.Windows.Controls.DataGridColumn]'.

System.Xaml.XamlServices.Save throws:

Constructor on type 'System.ComponentModel.ComponentConverter' not found.

I already found in forum that XAML does not fully support generics, however, is there a solution for this? I'm a bit confused because if XAML can be read dynamically it should also be possible to save it...

I use .NET Framework 4.

Thanks for reply... any suggestion is very welcome.

binary to XML Encoding problem


hi all,

I have CLR function written in following code,

=======CLR FUNCTION=========

    public static string Str2UTF8ASCII(string sMain,string RCSeq)
            ASCIIEncoding ascii = new ASCIIEncoding();
            byte[] byteArray = Encoding.UTF8.GetBytes(sMain);
            byte[] asciiArray = Encoding.Convert(Encoding.UTF8, Encoding.ASCII, byteArray);
            string finalString = ascii.GetString(asciiArray);
            return finalString.Replace("?X?X?", RCSeq);

       public static byte[] StringToByte(String hex)
            int NumberChars = hex.Length;
            byte[] bytes = new byte[NumberChars / 2];
            for (int i = 0; i < NumberChars; i +

Serialization Problem....



i am trying this code but its giving me "There is an error in XML document (0, 0)."

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using System.Text.RegularExpressions;
using System.Xml.Serialization;
using System.IO;

namespace GridViewPaging
    public class Person
        private string _name;
        private CNIC _cnic;

        public string Name
                _name = value;
                return _name;

        public string NIC
                _cnic.NIC = value;
                return _cnic.NIC;


    public struct CNIC
        private string _cnic;
        private bool _isValid;

        public string NIC
                if (IsCNICValid(value))
                    _isValid = true;
                    _cnic = value;
                    _isValid = false;
                if (

Activity field xml serialization problem


Hello,first of all I beg your pardon if my question could be out of topic, but I don't know where to address it. I'm working with 3.5 workflow foundation and I have a custom activity with a field of type DictionaryList, which is a serializable class containing some simple typed members, and a FeedbackItem[] member. FeedbackItem is a serializable class containing an ID (int), a Type (System.Type) and a Value (System.Object) fields. In the designer when I edit the custom activity, and I set the List Property (by using a PropertyGrid) i fill the DictionaryList class with all fields including the array of FeedbackItem. When I save the designer saves the workflow in a xoml file. When I load the xoml in the designer and I open the designer of the List property of the activity the DictionaryList object stored in previous session is missing the contrent of the FeedbackItem array; the FeedbackItems property has a FeedbackItem[0]. It seems like the xml serializer serializes the DictionaryList object but it can't deserialize it completely. Is there something I have to beware of? It's possible that some field in the FeedbackItem is not serializable and causes some error in deserialization process? I don't understand because il I edit the xoml file I can read the array like this:

    <x:Array Type="{x:Ty

Binary Serialization versioning issue


I have a binary serialization versioning issue that I haven't been able to figure out. Say I start out with the following ( call this V1 )

 interface IFoo
  void Test();

 class Foo : IFoo
  string data = "something";
  Bar bar;
  public Foo() { bar = new Bar(this); }
  public void Test() { Console.WriteLine("Foo {0}", data); }

 class Bar
  IFoo foo;
  public Bar(IFoo foo) { this.foo = foo; }

and then later I add another class ( call this version V2 )


Problem to group radio button across gridview rows

In general no one can easily group or make a single selection from radio button list inside gridview rows. There are a lot of way to make a single or unique selection from list. Here i want to share how i can address this problem in the most easiest way. Googling the problem most of the cases i saw the grouping in horizontal way. Thats why i tried to group the radio buttons in vertical manner. Let i have a requirement like below:

Regrading Sharpoint 2010 problem and solutions

We can write your question and problem on this blogger.you get ans.use.

This sharpoint 2010 problem solving threads

Hi friend,

you can use this thread to solving problem and solutions.

Virtual Path Problem


 I get the following error on last line below (working on remote host): 'E:\web\sfcascom\ls_admin/uploads/images/001.JPG' is not a valid virtual path,

Note that the slashes go in different directions

I've tried a number of things but nothing seems to work. Thanks-


Imports System.Drawing
Imports System.Drawing.Drawing2D
Imports System.Drawing.Imaging
Imports System.Web.UI.WebControls

Imports System.Drawing.Imaging.ImageCodecInfo
Partial Class Protected_imageupload
    Inherits System.Web.UI.Page
    Private Sub btnUpload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUpload.Click
        ' Initialize variables
        Dim sSavePath As String
        Dim sThumbExtension As String
        Dim intThumbWidth As Integer
        Dim intThumbHeight As Integer
        Dim sFilename As String = ""
        ' Set constant values
        'sSavePath = "images/"
        sSavePath = Server.MapPath("~/") + "ls_admin/uploads/images/"

        sThumbExtension = "_thumb"
        intThumbWidth = 160
        intThumbHeight = 120

        ' If file field isn?t empty
        If FilUpload.PostedFile IsNot Nothing Then
            ' Check file size (mustn?t be 0)
            Dim myFile As Http
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend