473,326 Members | 2,128 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,326 software developers and data experts.

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 2261
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
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.