473,394 Members | 1,951 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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.SerializationExceptio n: Possible Version
mismatch. Type System.Data.SqlClient.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(VersionAdded=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
Aug 30 '07 #1
1 1401

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 OptionalFieldAttribute 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
Aug 31 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Mike Sarbu | last post by:
Hello all, I have an XML file like this: <?xml version="1.0" encoding="utf-8"?> <SomeObject xmlns="http://www.abcinc.com/objectdefinition"...
3
by: Amadelle | last post by:
Hi all and thanks in advance for your help, I am having problems deserializing an object which seems to be serializing just fine. I save the byte array of the serialized object in the database...
3
by: AnkitAsDeveloper [Ankit] | last post by:
Hi i am serializing a 'ref struct' object as follows : private: void Seri( String ^path, Object^ obj ) { FileStream^ fileStrm ; try { //Serialize entire object into Binary stream
0
by: tshad | last post by:
Where does this error come from and what causes it? Possible Version mismatch. Type FtsData.Position has 142 members, number of members deserialized is 102. I did find a post that refers to...
2
by: andreas | last post by:
Hi, if have a object arrSdList of type SortedList for serialization and deserialization there are two subs for doing this Public Sub deser Dim Formatter As BinaryFormatter = New...
2
by: Clark Sann | last post by:
I've added a property to one of my classes and now, when I deserialize it I am getting a version mismatch. How to you add or subtract properties in classes that are being serialized /...
8
by: ashoksrini | last post by:
Hi All, I have the below requirement and would like to get some feeback from the group on the best way to implement: 1. I have WSDL defined exposing few web services. 2. We dont have a...
3
by: John Glover | last post by:
To whoever can help, I've been having a problem with XML deserialization lately. I needed to serialize and deserialze two objects which inherited from Hashtable. Because IDictionary...
1
by: Mythran | last post by:
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.