Hello Francois,
Welcome to the MSDN newsgroup.
From your description, I understand you're developing an ASP.NET webservice
which return some large dataset (typed?) to the client .net application.
Currently you've used a component library (from the following codeproject
space) to perform some DataSet compression task,
http://www.codeproject.com/csharp/cs...rumid=164592&e
xp=0&select=1195709
however, it will report "asembly 'App_code.....' ...." not found error at
runtime, correct?
As for this issue, it is likely an assembly binding/search issue caused by
..net binary serialization, I've downloaded the code package of that
codeproject article, the "CompressionHelper" class contains many
compressxxx methods and are you using the "CompressDataSet" method to
compress your DataSet, and then convert the compressed byte[] into string
and return to client?
Based on my review on the code, the "CompressDataSet" method is using
"BinaryFormatter" to binary serialize the DataSet into byte stream (as
below);
=============================
public static byte[] CompressDataSet(
DataSet input )
{
BinaryFormatter bf = new BinaryFormatter();
using ( MemoryStream ms = new MemoryStream() )
{
bf.Serialize( ms, input );
return CompressBytes( ms.GetBuffer() );
}
}
==============================
And binaryformatter serializer will identify the exact class name and
assembly(when serializing and deserializing), that's why you get the
assembly not found at client-side when deserializing the byte[] into
dataset(it is looking for the DataSet's assembly on server-side).
Therefore, for your scenario, you can consider the following means to
resolve the problem:
1. Still use the original "CompressDataSet" implementation, however, we
need to make sure our DataSet class's assemby is deployed in both server
webservice and client application projects. Since ASP.NET 2.0 will compile
DataSet (in App_code ) into a dynamic random assembly, I suggest you
separate the DataSet or other similar classes into a external class library
project. Thus, you can reference this class library assembly and classes in
both client and server project.
2. You can customize the CompressDataSet method and not use Binaryformatter
serialize. Instead, you can use DataSet.GetXml method to export the dataset
into XML string and use the compress component's CompressString method to
compress the DataSet's string format value. After that tranfer the
compressed string value to client.
Please let me know if you have anything unclear or if there is anything
else I missed.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial
response from the community or a Microsoft Support Engineer within 1
business day is
acceptable. Please note that each follow up response may take approximately
2 business days
as the support professional working with you may need further investigation
to reach the
most efficient resolution. The offering is not appropriate for situations
that require
urgent, real-time or phone-based interactions or complex project analysis
and dump analysis
issues. Issues of this nature are best handled working with a dedicated
Microsoft Support
Engineer by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.