473,382 Members | 1,665 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,382 software developers and data experts.

Can not load an assembly into an appdomain

2
Hi all,
Because I have to load and unload an assembly, so I try to create a new appdomain and load the assembly into it. But it throws an exception with the message "Insufficient state to deserialize the object. More information is needed.". I don't know how to fix this problem. Pls help me. Thanks.
This is my code in C#
public static object CreateInstance(string path)
{
AppDomain extDom = AppDomain.CreateDomain("HELLO");
AssemblyName extName = new AssemblyName();
//this is sample path for DLL file
extName.CodeBase = @"file://C:\\sample.dll";
Assembly extDll=extDom.Load(extName); //exception is throw in this line
Type extType=extDll.GetExportedTypes()[0];
object extObj = extDom.CreateInstanceAndUnwrap(extDll.FullName, extType.FullName);
return extObj;
}
Aug 8 '07 #1
2 1260
linhnc
2
I have tried many ways, but it can not be resolved. Pls help me. Thanks
Aug 9 '07 #2
kenobewan
4,871 Expert 4TB
This error is often caused because it can't load a particular assembly. Make sure the assembly is findable, for example by placing it into the GAC or the
program directory of the .exe which is doing the deserialization. Can you give all the Exception information (call stack, message, etc)?
Aug 9 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Raveendra | last post by:
Hi! I am trying to create one new Application Domain and calling one Assembly in that created Application Domain. It is working fine with stand alone application. But I need to do the same with...
2
by: Lauren Hines | last post by:
Hello, I have read numerous post stating that the only way to unload an assembly (DLL in my case) is to create a separate AppDomain, load the assembly, then unload it by calling AppDomain.Unload....
2
by: brianbender | last post by:
I am trying to load and unload assemblies dynamically and call methods and properties when loaded into an Appdomain I can load assemblies all day in the current AppDomain without references and...
1
by: John | last post by:
Hi, I tried to load a mixedmode dll (MC++) with AppDomain.Load(Byte ) in a C# Client. During the Load Process I got the following Exception: System.IO.FileLoadException: Ausnahme von...
6
by: Steve | last post by:
I'm playing with late binding and trying a very simple test to load an assembly In my "Host" application I have this code: <code> string modulePath =...
3
by: Frank Uray | last post by:
Hi all I have a problem with loading a assembly ... I am trying to do the following: - I have a directory with a dll (assembly) in it (not the currect dir.) - I am trying to load this assembly,...
1
by: chandu | last post by:
hello , i want to load and execute an existing dll in a applicaiton dynamically with out giving references etc... need to create separate appdomain or in same appdomain can i load and execute...
0
by: =?Utf-8?B?VmFubmk=?= | last post by:
Hello, I am trying to load up an Assembly in a newly created AppDomain: m_TempAppDomain = AppDomain.CreateDomain("Temporary", null, AppDomain.CurrentDomain.SetupInformation); byte...
1
by: ThunderMusic | last post by:
Hi, (My code is at the end of this post) I have an AppDomain that must load a simple assembly that has only one class with one method and it does not work... I receive this exception : "Could...
2
by: =?Utf-8?B?UGFi?= | last post by:
Hello, I am confused with load assembly in AppDomain. I created ASP Web application, same business logic is realized in custom DLLs, and I need to load ones in my application. If I use...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.