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 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
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
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
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
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 >> >> >>
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 > > > This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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.
...
|
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,...
|
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...
|
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,...
|
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...
|
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...
|
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...
|
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,...
|
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...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |