SqlError Deserialization - Possible Version mismatch.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mythran

    #1

    SqlError Deserialization - Possible Version mismatch.

    We have an application on one server and a web service on another server.
    Our BLL and DAL layers are behind the web service. When a SqlException is
    thrown, the application receives the following error:

    System.Runtime. Serialization.S erializationExc eption: Possible Version
    mismatch. Type System.Data.Sql Client.SqlError has 8 members, number of
    members deserialized is 7.

    After reviewing SqlError, framework v1.1 contains the following fields:

    private byte errorClass;
    private int lineNumber;
    private string message;
    private int number;
    private string procedure;
    private string source = ".Net SqlClient Data Provider";
    private byte state;

    SqlError, framework v2.0 contains:

    private byte errorClass;
    private int lineNumber;
    private string message;
    private int number;
    private string procedure;
    [OptionalField(V ersionAdded=2)]
    private string server;
    private string source = ".Net SqlClient Data Provider";
    private byte state;

    I'm assuming that the application itself is running on v2.0 somehow. I
    checked the ASP.Net tab in IIS for the application and it is set to run
    under .Net 1.1, not 2.0...anyone familiar with this and can shed some light
    or any other types of tests I can run.

    Thanks,
    Mythran


  • Mythran

    #2
    Re: SqlError Deserialization - Possible Version mismatch.


    Bah, found the problem. The System.Data.dll version on the web service
    server was 1.1.4322.2032 while the version of the same dll on the
    application server was 1.1.4322.2300. Go figure. The dll on the
    application server DOES define the new field that is visible in the 2.0 dll,
    but it doesn't have the OptionalFieldAt tribute and thus, the serialization
    process throws the exception because there is an extra field in the dll that
    is used when deserializing.

    Hope this helps anyone else out there with similar probs :)

    Thanks,
    Mythran


    Comment

    Working...