473,513 Members | 2,366 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"Insufficient state to deserialize the object. More information is needed." AppDomain Load

I am using the code below and I am getting this error:
"Insufficient state to deserialize the object. More information is needed."
Has anyone seen this? It is working with other dll's but not on a certain
one. Can some help?


private void LoadAssembly(string DllLocationDirectory, string
applicationName, bool shadowCopyFiles, string friendlyName, string dllName,
string className)
{
AppDomainSetup setup = new AppDomainSetup();
setup.ApplicationBase = DllLocationDirectory;
setup.ApplicationName = applicationName;
setup.ShadowCopyFiles = shadowCopyFiles.ToString();
setup.ShadowCopyDirectories = DllLocationDirectory;

this._AppDomain = AppDomain.CreateDomain(friendlyName, null, setup);

SetAppDomainPolicy(_AppDomain);

byte[] AssemblyBtyes = this.LoadAssemblyBytes(DllLocationDirectory +
dllName);
Assembly asm = this._AppDomain.Load(AssemblyBtyes);
this._ClassLoaded = asm.CreateInstance(className);
}

private byte[] LoadAssemblyBytes(string filename)
{
FileStream fin = new FileStream(filename, FileMode.Open,FileAccess.Read);
byte[] bin = new byte[16384];
long rdlen = 0;
long total= fin.Length;
int len;
MemoryStream memStream = new MemoryStream((int)total);
rdlen = 0;
while(rdlen < total)
{
len = fin.Read(bin, 0, 16384);
memStream.Write(bin, 0, len);
rdlen = rdlen + len;
}
// done with input file
fin.Close();
return memStream.ToArray();
}
Nov 22 '05 #1
0 880

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

Similar topics

0
2730
by: Bob Cannistraci | last post by:
A three-tier user authentication system was running without a problem for almost a year and now is suddenly dysfunctional. We don't know of any changes to any of the servers. It's quite maddening....
3
3765
by: Sean McKaharay | last post by:
I am using the code below and I am getting this error: "Insufficient state to deserialize the object. More information is needed." Has anyone seen this? It is working with other dll's but not on a...
1
3275
by: Paul Tomlinson | last post by:
Question about a System.Threading.Timer object and the "state" object you pass to it... Timer stateTimer = new Timer( = new TimerCallback( OnTimer ), o, 1000, 1000); I have an array of timer...
1
2342
by: Lauchlan M | last post by:
Hi. I'm using ASP.NET, getting an "Object reference not set to an instance of an object" error. In my login.aspx page I have: string arrUserRoles = new string {"UserRole"};...
1
3564
by: Sidney Pecul | last post by:
I setup the SessionState (out-of-process in SQLServer). I can query ASPState..ASPStateTempSessions table. However, "SessionItemShort" content is serialized. Is it a way to "deserialize" ...
4
1187
by: Hrishi R | last post by:
Hi: The following ASP.NET code segment throws an "Object reference not set to an instance of an object" exception. ------------------ Public Sub Page_Load(Source As Object, E As EventArgs) ...
3
2871
by: Michel Couche | last post by:
Hello, I have an ASP.Net application that uses the Wizard control to build a newsletter. There are three steps in the wizard. The customer's specific design data are loaded from a database in...
0
2639
by: Tamer Ibrahim | last post by:
Hi, Sometimes, I got the following error message when I use ajax calendar control on some aspx pages : Object reference not set to an instance of an object. Description: An unhandled exception...
1
7078
by: =?ISO-8859-1?Q?Lasse_V=E5gs=E6ther_Karlsen?= | last post by:
I get the above error in some of the ASP.NET web applications on a server, and I need some help figuring out how to deal with it. This is a rather long post, and I hope I have enough details that...
14
2495
by: =?GB2312?B?zPC5zw==?= | last post by:
Howdy, I wonder why below does not work. a = object() a.b = 1 # dynamic bind attribute failed... To make it correct, we have to create a new class: class MyClass(object): pass a =...
0
7267
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
7391
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
7553
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5697
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5100
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4754
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3247
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3235
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
466
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.