473,466 Members | 1,298 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

AppDomain.CreateDomain pb!

Hello!

I have a serializationEception. Impossible to deserialize the object.
I have try with app.AssemblyResolve but i have not found the solution.

My purpose is to launch my program directly from the memory.

// Bhe bytes in the assembly.
byte[] byteload = null;

// Open the file stream and read the bytes.
using (FileStream fs = new FileStream(@"C:\Documents and
Settings\Berdoues\Mes documents\Visual Studio
Projects\Application_Test_WindowsForm\LoadAssembly \CaptureControl.exe",FileMode.Open))
{
// Create the byte array with the length.
byteload = new byte[fs.Length];

// Read the bytes.
fs.Read(byteload, 0, byteload.Length);
}

AppDomain app = AppDomain.CreateDomain("juju");
app.Load(byteload).EntryPoint.Invoke(null,null);
//app.AssemblyResolve +=new ResolveEventHandler(app_AssemblyResolve);

Thank you!

Wavemill
Nov 17 '05 #1
6 2264
Wavemill,

At what point are you getting the exception?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"wavemill" <wa******@discussions.microsoft.com> wrote in message
news:D2**********************************@microsof t.com...
Hello!

I have a serializationEception. Impossible to deserialize the object.
I have try with app.AssemblyResolve but i have not found the solution.

My purpose is to launch my program directly from the memory.

// Bhe bytes in the assembly.
byte[] byteload = null;

// Open the file stream and read the bytes.
using (FileStream fs = new FileStream(@"C:\Documents and
Settings\Berdoues\Mes documents\Visual Studio
Projects\Application_Test_WindowsForm\LoadAssembly \CaptureControl.exe",FileMode.Open))
{
// Create the byte array with the length.
byteload = new byte[fs.Length];

// Read the bytes.
fs.Read(byteload, 0, byteload.Length);
}

AppDomain app = AppDomain.CreateDomain("juju");
app.Load(byteload).EntryPoint.Invoke(null,null);
//app.AssemblyResolve +=new ResolveEventHandler(app_AssemblyResolve);

Thank you!

Wavemill

Nov 17 '05 #2
Hello!

The exception is on
app.Load(byteload).EntryPoint.Invoke(null,null);

Thank you

Wavemill

"Nicholas Paldino [.NET/C# MVP]" wrote:
Wavemill,

At what point are you getting the exception?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"wavemill" <wa******@discussions.microsoft.com> wrote in message
news:D2**********************************@microsof t.com...
Hello!

I have a serializationEception. Impossible to deserialize the object.
I have try with app.AssemblyResolve but i have not found the solution.

My purpose is to launch my program directly from the memory.

// Bhe bytes in the assembly.
byte[] byteload = null;

// Open the file stream and read the bytes.
using (FileStream fs = new FileStream(@"C:\Documents and
Settings\Berdoues\Mes documents\Visual Studio
Projects\Application_Test_WindowsForm\LoadAssembly \CaptureControl.exe",FileMode.Open))
{
// Create the byte array with the length.
byteload = new byte[fs.Length];

// Read the bytes.
fs.Read(byteload, 0, byteload.Length);
}

AppDomain app = AppDomain.CreateDomain("juju");
app.Load(byteload).EntryPoint.Invoke(null,null);
//app.AssemblyResolve +=new ResolveEventHandler(app_AssemblyResolve);

Thank you!

Wavemill


Nov 17 '05 #3
Well, there are three separate calls there, which one is it?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"wavemill" <wa******@discussions.microsoft.com> wrote in message
news:14**********************************@microsof t.com...
Hello!

The exception is on
app.Load(byteload).EntryPoint.Invoke(null,null);

Thank you

Wavemill

"Nicholas Paldino [.NET/C# MVP]" wrote:
Wavemill,

At what point are you getting the exception?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"wavemill" <wa******@discussions.microsoft.com> wrote in message
news:D2**********************************@microsof t.com...
> Hello!
>
> I have a serializationEception. Impossible to deserialize the object.
> I have try with app.AssemblyResolve but i have not found the solution.
>
> My purpose is to launch my program directly from the memory.
>
> // Bhe bytes in the assembly.
> byte[] byteload = null;
>
> // Open the file stream and read the bytes.
> using (FileStream fs = new FileStream(@"C:\Documents and
> Settings\Berdoues\Mes documents\Visual Studio
> Projects\Application_Test_WindowsForm\LoadAssembly \CaptureControl.exe",FileMode.Open))
> {
> // Create the byte array with the length.
> byteload = new byte[fs.Length];
>
> // Read the bytes.
> fs.Read(byteload, 0, byteload.Length);
> }
>
> AppDomain app = AppDomain.CreateDomain("juju");
> app.Load(byteload).EntryPoint.Invoke(null,null);
> //app.AssemblyResolve +=new ResolveEventHandler(app_AssemblyResolve);
>
> Thank you!
>
> Wavemill


Nov 17 '05 #4
Hello!

I dont understand the question

wavemill

"Nicholas Paldino [.NET/C# MVP]" wrote:
Well, there are three separate calls there, which one is it?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"wavemill" <wa******@discussions.microsoft.com> wrote in message
news:14**********************************@microsof t.com...
Hello!

The exception is on
app.Load(byteload).EntryPoint.Invoke(null,null);

Thank you

Wavemill

"Nicholas Paldino [.NET/C# MVP]" wrote:
Wavemill,

At what point are you getting the exception?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"wavemill" <wa******@discussions.microsoft.com> wrote in message
news:D2**********************************@microsof t.com...
> Hello!
>
> I have a serializationEception. Impossible to deserialize the object.
> I have try with app.AssemblyResolve but i have not found the solution.
>
> My purpose is to launch my program directly from the memory.
>
> // Bhe bytes in the assembly.
> byte[] byteload = null;
>
> // Open the file stream and read the bytes.
> using (FileStream fs = new FileStream(@"C:\Documents and
> Settings\Berdoues\Mes documents\Visual Studio
> Projects\Application_Test_WindowsForm\LoadAssembly \CaptureControl.exe",FileMode.Open))
> {
> // Create the byte array with the length.
> byteload = new byte[fs.Length];
>
> // Read the bytes.
> fs.Read(byteload, 0, byteload.Length);
> }
>
> AppDomain app = AppDomain.CreateDomain("juju");
> app.Load(byteload).EntryPoint.Invoke(null,null);
> //app.AssemblyResolve +=new ResolveEventHandler(app_AssemblyResolve);
>
> Thank you!
>
> Wavemill


Nov 17 '05 #5
Wavemill,

When you make a call like this:

app.Load(byteload).EntryPoint.Invoke(null,null);

It is actually the same as this:

Assembly asm = app.Load(byteload);
MethodInfo m = asm.EntryPoint;
m.Invoke(null, null);

Those are three separate calls that can throw the exception. Which one
is it?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"wavemill" <wa******@discussions.microsoft.com> wrote in message
news:90**********************************@microsof t.com...
Hello!

I dont understand the question

wavemill

"Nicholas Paldino [.NET/C# MVP]" wrote:
Well, there are three separate calls there, which one is it?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"wavemill" <wa******@discussions.microsoft.com> wrote in message
news:14**********************************@microsof t.com...
> Hello!
>
> The exception is on
> app.Load(byteload).EntryPoint.Invoke(null,null);
>
> Thank you
>
> Wavemill
>
> "Nicholas Paldino [.NET/C# MVP]" wrote:
>
>> Wavemill,
>>
>> At what point are you getting the exception?
>>
>>
>> --
>> - Nicholas Paldino [.NET/C# MVP]
>> - mv*@spam.guard.caspershouse.com
>>
>> "wavemill" <wa******@discussions.microsoft.com> wrote in message
>> news:D2**********************************@microsof t.com...
>> > Hello!
>> >
>> > I have a serializationEception. Impossible to deserialize the
>> > object.
>> > I have try with app.AssemblyResolve but i have not found the
>> > solution.
>> >
>> > My purpose is to launch my program directly from the memory.
>> >
>> > // Bhe bytes in the assembly.
>> > byte[] byteload = null;
>> >
>> > // Open the file stream and read the bytes.
>> > using (FileStream fs = new FileStream(@"C:\Documents and
>> > Settings\Berdoues\Mes documents\Visual Studio
>> > Projects\Application_Test_WindowsForm\LoadAssembly \CaptureControl.exe",FileMode.Open))
>> > {
>> > // Create the byte array with the length.
>> > byteload = new byte[fs.Length];
>> >
>> > // Read the bytes.
>> > fs.Read(byteload, 0, byteload.Length);
>> > }
>> >
>> > AppDomain app = AppDomain.CreateDomain("juju");
>> > app.Load(byteload).EntryPoint.Invoke(null,null);
>> > //app.AssemblyResolve +=new
>> > ResolveEventHandler(app_AssemblyResolve);
>> >
>> > Thank you!
>> >
>> > Wavemill
>>
>>
>>


Nov 17 '05 #6
The error is :
Assembly asm = app.Load(byteload);

thank you and sorry for my bad english!

Wavemill

"wavemill" wrote:
Hello!

I dont understand the question

wavemill

"Nicholas Paldino [.NET/C# MVP]" wrote:
Well, there are three separate calls there, which one is it?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"wavemill" <wa******@discussions.microsoft.com> wrote in message
news:14**********************************@microsof t.com...
Hello!

The exception is on
app.Load(byteload).EntryPoint.Invoke(null,null);

Thank you

Wavemill

"Nicholas Paldino [.NET/C# MVP]" wrote:

> Wavemill,
>
> At what point are you getting the exception?
>
>
> --
> - Nicholas Paldino [.NET/C# MVP]
> - mv*@spam.guard.caspershouse.com
>
> "wavemill" <wa******@discussions.microsoft.com> wrote in message
> news:D2**********************************@microsof t.com...
> > Hello!
> >
> > I have a serializationEception. Impossible to deserialize the object.
> > I have try with app.AssemblyResolve but i have not found the solution.
> >
> > My purpose is to launch my program directly from the memory.
> >
> > // Bhe bytes in the assembly.
> > byte[] byteload = null;
> >
> > // Open the file stream and read the bytes.
> > using (FileStream fs = new FileStream(@"C:\Documents and
> > Settings\Berdoues\Mes documents\Visual Studio
> > Projects\Application_Test_WindowsForm\LoadAssembly \CaptureControl.exe",FileMode.Open))
> > {
> > // Create the byte array with the length.
> > byteload = new byte[fs.Length];
> >
> > // Read the bytes.
> > fs.Read(byteload, 0, byteload.Length);
> > }
> >
> > AppDomain app = AppDomain.CreateDomain("juju");
> > app.Load(byteload).EntryPoint.Invoke(null,null);
> > //app.AssemblyResolve +=new ResolveEventHandler(app_AssemblyResolve);
> >
> > Thank you!
> >
> > Wavemill
>
>
>


Nov 17 '05 #7

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

Similar topics

2
by: Satinderpal Singh | last post by:
Hi All, I have an EXE, I load the DLL from that exe in a seperate AppDomain. (I have not given reference to that DLL from the EXE). Now, i call some commands of that dll from the EXE, and in...
5
by: Chris | last post by:
Hi I have a scenario where I've created another AppDomain to dynamically load a DLL(s) into. In this newly loaded DLL I want to call a static method on a class. The problem arise is that I have...
4
by: Chris Lacey | last post by:
Hi, I'm currently writing a scheduling service which starts a number DotNet executables, each within a new AppDomain, every ten seconds. The guts of the code is as follows: // For each...
8
by: A. Elamiri | last post by:
Hello, I created a small app which acts as a services manager. I basically drop a DLL in a Services folder and set the frequency through the application for how often do I want the code in the...
6
by: Wal Turner | last post by:
Hi there. There are various snippets on forums regarding issues with AppDomain.Unload and how it just doesnt work. Fortunately, I got it working with the base case, after much fiddling. Consider...
0
by: wavemill | last post by:
I have a serializationEception. Impossible to deserialize the object. I have try with app.AssemblyResolve but i have not found the solution. My purpose is to launch my program directly from the...
1
by: Andrew Ducker | last post by:
I'm trying to load an assembly into a temporary AppDomain rather than my main AppDomain, so that it can be unloaded later on. However, it's also loading into my main AppDomain at the same time. ...
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: Joe Duchtel | last post by:
Hello - I am using the AppDomain.CreateDomain() function to load an assembly from a local *.dll where the *.dll is also in the GAC. This worked fine for .NET 1.1 where it would load the local...
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...
1
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
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
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
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
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.