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 assembly to run (scheduler).
I created a seperate AppDomain here is the code:
....
AppDomainSetup ads = new AppDomainSetup();
string path =
Application.ExecutablePath.Replace(System.IO.Path. GetFileName(Application.Ex
ecutablePath),"");
ads.ApplicationBase = path + "Services";
ads.PrivateBinPathProbe = path + "Services";
ads.PrivateBinPath = path + "Services";
ads.DisallowBindingRedirects = true;
Tools.ShowInfo(path);
SvcBin = AppDomain.CreateDomain("ServiceAssemblies",null,ad s);
....
The above code was placed in the constructor. When I look through the
assemblies (GetAssemblies) to see a listing of all classes loaded, I don't
see the classes in the dll located in that services folder, which made me
think that it is not being probed. Anything I'm doing wrong?
--
Abdellah Elamiri
..net Developer
Efficacy through simplicity 8 5065
The code you have by itself won't cause the assemblies in the Services
folder to be loaded -- it just creates a AppDomain. The assemblies will be
loaded the first time you create an instance of an object from one of them
(e.g., with AppDomain.CreateInstance()) or when you explicitly load them
(e.g., with AppDomain.Load()).
Ken
"A. Elamiri" <abdellahDOTelamiriATclintonDOTedutNOSPAM> wrote in message
news:OE**************@TK2MSFTNGP11.phx.gbl... 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 assembly to run (scheduler).
I created a seperate AppDomain here is the code: ... AppDomainSetup ads = new AppDomainSetup(); string path =
Application.ExecutablePath.Replace(System.IO.Path. GetFileName(Application.Ex ecutablePath),""); ads.ApplicationBase = path + "Services"; ads.PrivateBinPathProbe = path + "Services"; ads.PrivateBinPath = path + "Services"; ads.DisallowBindingRedirects = true; Tools.ShowInfo(path); SvcBin = AppDomain.CreateDomain("ServiceAssemblies",null,ad s);
...
The above code was placed in the constructor. When I look through the assemblies (GetAssemblies) to see a listing of all classes loaded, I don't see the classes in the dll located in that services folder, which made me think that it is not being probed. Anything I'm doing wrong? -- Abdellah Elamiri .net Developer Efficacy through simplicity
In the code you have posted you have created the domain. but you haven't
loaded the assembly yet.
On the created domain you should call Load and pass the assembly which you
are trying to load as a param.
This time you don't have to pass any path information because that was
already supplied to the AppDomainSetup object.
regards,
Abhishek.
"A. Elamiri" <abdellahDOTelamiriATclintonDOTedutNOSPAM> wrote in message
news:OE**************@TK2MSFTNGP11.phx.gbl... 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 assembly to run (scheduler).
I created a seperate AppDomain here is the code: ... AppDomainSetup ads = new AppDomainSetup(); string path =
Application.ExecutablePath.Replace(System.IO.Path. GetFileName(Application.Ex ecutablePath),""); ads.ApplicationBase = path + "Services"; ads.PrivateBinPathProbe = path + "Services"; ads.PrivateBinPath = path + "Services"; ads.DisallowBindingRedirects = true; Tools.ShowInfo(path); SvcBin = AppDomain.CreateDomain("ServiceAssemblies",null,ad s);
...
The above code was placed in the constructor. When I look through the assemblies (GetAssemblies) to see a listing of all classes loaded, I don't see the classes in the dll located in that services folder, which made me think that it is not being probed. Anything I'm doing wrong? -- Abdellah Elamiri .net Developer Efficacy through simplicity
Thanks for the replies, but now I'm getting a different error
Additional information: Insufficient state to deserialize the object. More
information is needed.
this occurs at this line
OwnerForm.SvcBin.Load("ClintonServices");
SvcBin is an AppDomain created by the OwnerForm, OwnerForm is simply the
parent windows form
--
Abdellah Elamiri
..net Developer
Efficacy through simplicity
"Abhishek Srivastava" <ab******@nospam.net> wrote in message
news:uK**************@TK2MSFTNGP12.phx.gbl... In the code you have posted you have created the domain. but you haven't loaded the assembly yet.
On the created domain you should call Load and pass the assembly which you are trying to load as a param.
This time you don't have to pass any path information because that was already supplied to the AppDomainSetup object.
regards, Abhishek.
"A. Elamiri" <abdellahDOTelamiriATclintonDOTedutNOSPAM> wrote in message news:OE**************@TK2MSFTNGP11.phx.gbl... 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 assembly to run (scheduler).
I created a seperate AppDomain here is the code: ... AppDomainSetup ads = new AppDomainSetup(); string path =
Application.ExecutablePath.Replace(System.IO.Path. GetFileName(Application.Ex ecutablePath),""); ads.ApplicationBase = path + "Services"; ads.PrivateBinPathProbe = path + "Services"; ads.PrivateBinPath = path + "Services"; ads.DisallowBindingRedirects = true; Tools.ShowInfo(path); SvcBin = AppDomain.CreateDomain("ServiceAssemblies",null,ad s);
...
The above code was placed in the constructor. When I look through the assemblies (GetAssemblies) to see a listing of all classes loaded, I
don't see the classes in the dll located in that services folder, which made
me think that it is not being probed. Anything I'm doing wrong? -- Abdellah Elamiri .net Developer Efficacy through simplicity
When you call AppDomain.Load() from a different AppDomain than the one in
which the assembly is loaded, you can often run into this problem. What's
happened is the assembly is indeed loaded into the other app domain. But, it
then attempts to return the assembly reference to the calling AppDomain.
That requires the calling AppDomain to load the assembly as well. But, since
the assembly isn't in the calling AppDomain's probing path (current
directory), the load fails.
Ken
"A. Elamiri" <abdellahDOTelamiriATclintonDOTedutNOSPAM> wrote in message
news:%2******************@TK2MSFTNGP12.phx.gbl... Thanks for the replies, but now I'm getting a different error
Additional information: Insufficient state to deserialize the object.
More information is needed.
this occurs at this line OwnerForm.SvcBin.Load("ClintonServices");
SvcBin is an AppDomain created by the OwnerForm, OwnerForm is simply the parent windows form
-- Abdellah Elamiri .net Developer Efficacy through simplicity "Abhishek Srivastava" <ab******@nospam.net> wrote in message news:uK**************@TK2MSFTNGP12.phx.gbl... In the code you have posted you have created the domain. but you haven't loaded the assembly yet.
On the created domain you should call Load and pass the assembly which
you are trying to load as a param.
This time you don't have to pass any path information because that was already supplied to the AppDomainSetup object.
regards, Abhishek.
"A. Elamiri" <abdellahDOTelamiriATclintonDOTedutNOSPAM> wrote in message news:OE**************@TK2MSFTNGP11.phx.gbl... 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 assembly to run (scheduler).
I created a seperate AppDomain here is the code: ... AppDomainSetup ads = new AppDomainSetup(); string path =
Application.ExecutablePath.Replace(System.IO.Path. GetFileName(Application.Ex ecutablePath),""); ads.ApplicationBase = path + "Services"; ads.PrivateBinPathProbe = path + "Services"; ads.PrivateBinPath = path + "Services"; ads.DisallowBindingRedirects = true; Tools.ShowInfo(path); SvcBin = AppDomain.CreateDomain("ServiceAssemblies",null,ad s);
...
The above code was placed in the constructor. When I look through the assemblies (GetAssemblies) to see a listing of all classes loaded, I don't see the classes in the dll located in that services folder, which made me think that it is not being probed. Anything I'm doing wrong? -- Abdellah Elamiri .net Developer Efficacy through simplicity
That helped! thanks a lot everyone who answered
--
Abdellah Elamiri
..net Developer
Efficacy through simplicity
"Ken Kolda" <ke*******@elliemae-nospamplease.com> wrote in message
news:ui**************@tk2msftngp13.phx.gbl... When you call AppDomain.Load() from a different AppDomain than the one in which the assembly is loaded, you can often run into this problem. What's happened is the assembly is indeed loaded into the other app domain. But,
it then attempts to return the assembly reference to the calling AppDomain. That requires the calling AppDomain to load the assembly as well. But,
since the assembly isn't in the calling AppDomain's probing path (current directory), the load fails.
Ken
"A. Elamiri" <abdellahDOTelamiriATclintonDOTedutNOSPAM> wrote in message news:%2******************@TK2MSFTNGP12.phx.gbl... Thanks for the replies, but now I'm getting a different error
Additional information: Insufficient state to deserialize the object. More information is needed.
this occurs at this line OwnerForm.SvcBin.Load("ClintonServices");
SvcBin is an AppDomain created by the OwnerForm, OwnerForm is simply the parent windows form
-- Abdellah Elamiri .net Developer Efficacy through simplicity "Abhishek Srivastava" <ab******@nospam.net> wrote in message news:uK**************@TK2MSFTNGP12.phx.gbl... In the code you have posted you have created the domain. but you
haven't loaded the assembly yet.
On the created domain you should call Load and pass the assembly which you are trying to load as a param.
This time you don't have to pass any path information because that was already supplied to the AppDomainSetup object.
regards, Abhishek.
"A. Elamiri" <abdellahDOTelamiriATclintonDOTedutNOSPAM> wrote in
message news:OE**************@TK2MSFTNGP11.phx.gbl... > 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 assembly to run (scheduler). > > I created a seperate AppDomain here is the code: > ... > AppDomainSetup ads = new AppDomainSetup(); > string path = >
Application.ExecutablePath.Replace(System.IO.Path. GetFileName(Application.Ex > ecutablePath),""); > ads.ApplicationBase = path + "Services"; > ads.PrivateBinPathProbe = path + "Services"; > ads.PrivateBinPath = path + "Services"; > ads.DisallowBindingRedirects = true; > Tools.ShowInfo(path); > SvcBin = AppDomain.CreateDomain("ServiceAssemblies",null,ad s); > > ... > > The above code was placed in the constructor. When I look through
the > assemblies (GetAssemblies) to see a listing of all classes loaded, I don't > see the classes in the dll located in that services folder, which
made me > think that it is not being probed. Anything I'm doing wrong? > -- > Abdellah Elamiri > .net Developer > Efficacy through simplicity > >
Hi Ken,
just curious (never had to deal with this) - how the you load an
assembly in the new appdomain without loading it in the calling one?
Sunny
In article <ui**************@tk2msftngp13.phx.gbl>, ken.kolda@elliemae-
nospamplease.com says... When you call AppDomain.Load() from a different AppDomain than the one in which the assembly is loaded, you can often run into this problem. What's happened is the assembly is indeed loaded into the other app domain. But, it then attempts to return the assembly reference to the calling AppDomain. That requires the calling AppDomain to load the assembly as well. But, since the assembly isn't in the calling AppDomain's probing path (current directory), the load fails.
Ken
"A. Elamiri" <abdellahDOTelamiriATclintonDOTedutNOSPAM> wrote in message news:%2******************@TK2MSFTNGP12.phx.gbl... Thanks for the replies, but now I'm getting a different error
Additional information: Insufficient state to deserialize the object. More information is needed.
this occurs at this line OwnerForm.SvcBin.Load("ClintonServices");
SvcBin is an AppDomain created by the OwnerForm, OwnerForm is simply the parent windows form
-- Abdellah Elamiri .net Developer Efficacy through simplicity "Abhishek Srivastava" <ab******@nospam.net> wrote in message news:uK**************@TK2MSFTNGP12.phx.gbl... In the code you have posted you have created the domain. but you haven't loaded the assembly yet.
On the created domain you should call Load and pass the assembly which you are trying to load as a param.
This time you don't have to pass any path information because that was already supplied to the AppDomainSetup object.
regards, Abhishek.
"A. Elamiri" <abdellahDOTelamiriATclintonDOTedutNOSPAM> wrote in message news:OE**************@TK2MSFTNGP11.phx.gbl... > 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 assembly to run (scheduler). > > I created a seperate AppDomain here is the code: > ... > AppDomainSetup ads = new AppDomainSetup(); > string path = > Application.ExecutablePath.Replace(System.IO.Path. GetFileName(Application.Ex > ecutablePath),""); > ads.ApplicationBase = path + "Services"; > ads.PrivateBinPathProbe = path + "Services"; > ads.PrivateBinPath = path + "Services"; > ads.DisallowBindingRedirects = true; > Tools.ShowInfo(path); > SvcBin = AppDomain.CreateDomain("ServiceAssemblies",null,ad s); > > ... > > The above code was placed in the constructor. When I look through the > assemblies (GetAssemblies) to see a listing of all classes loaded, I don't > see the classes in the dll located in that services folder, which made me > think that it is not being probed. Anything I'm doing wrong? > -- > Abdellah Elamiri > .net Developer > Efficacy through simplicity > >
I've done this using the AppDomain.DoCallback(). Make sure the delegate is
marshal-by-value and have the delegate that's invoked call
AppDomain.CurrentDomain.Load(). Of course, that means the new appdomain will
have to load the assembly that contains the definition of the class
containing the delegate, so hopefully that's acceptable.
Ken
"Sunny" <su***@newsgroups.nospam> wrote in message
news:e$**************@TK2MSFTNGP09.phx.gbl... Hi Ken,
just curious (never had to deal with this) - how the you load an assembly in the new appdomain without loading it in the calling one?
Sunny
In article <ui**************@tk2msftngp13.phx.gbl>, ken.kolda@elliemae- nospamplease.com says... When you call AppDomain.Load() from a different AppDomain than the one
in which the assembly is loaded, you can often run into this problem.
What's happened is the assembly is indeed loaded into the other app domain.
But, it then attempts to return the assembly reference to the calling AppDomain. That requires the calling AppDomain to load the assembly as well. But,
since the assembly isn't in the calling AppDomain's probing path (current directory), the load fails.
Ken
"A. Elamiri" <abdellahDOTelamiriATclintonDOTedutNOSPAM> wrote in message news:%2******************@TK2MSFTNGP12.phx.gbl... Thanks for the replies, but now I'm getting a different error
Additional information: Insufficient state to deserialize the object. More information is needed.
this occurs at this line OwnerForm.SvcBin.Load("ClintonServices");
SvcBin is an AppDomain created by the OwnerForm, OwnerForm is simply
the parent windows form
-- Abdellah Elamiri .net Developer Efficacy through simplicity "Abhishek Srivastava" <ab******@nospam.net> wrote in message news:uK**************@TK2MSFTNGP12.phx.gbl... > In the code you have posted you have created the domain. but you
haven't > loaded the assembly yet. > > On the created domain you should call Load and pass the assembly
which you > are trying to load as a param. > > This time you don't have to pass any path information because that
was > already supplied to the AppDomainSetup object. > > regards, > Abhishek. > > "A. Elamiri" <abdellahDOTelamiriATclintonDOTedutNOSPAM> wrote in
message > news:OE**************@TK2MSFTNGP11.phx.gbl... > > 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 assembly to run (scheduler). > > > > I created a seperate AppDomain here is the code: > > ... > > AppDomainSetup ads = new AppDomainSetup(); > > string path = > > >
Application.ExecutablePath.Replace(System.IO.Path. GetFileName(Application.Ex > > ecutablePath),""); > > ads.ApplicationBase = path + "Services"; > > ads.PrivateBinPathProbe = path + "Services"; > > ads.PrivateBinPath = path + "Services"; > > ads.DisallowBindingRedirects = true; > > Tools.ShowInfo(path); > > SvcBin = AppDomain.CreateDomain("ServiceAssemblies",null,ad s); > > > > ... > > > > The above code was placed in the constructor. When I look through
the > > assemblies (GetAssemblies) to see a listing of all classes loaded,
I don't > > see the classes in the dll located in that services folder, which
made me > > think that it is not being probed. Anything I'm doing wrong? > > -- > > Abdellah Elamiri > > .net Developer > > Efficacy through simplicity > > > > > >
Thanks
In article <OY**************@TK2MSFTNGP11.phx.gbl>, ken.kolda@elliemae-
nospamplease.com says... I've done this using the AppDomain.DoCallback(). Make sure the delegate is marshal-by-value and have the delegate that's invoked call AppDomain.CurrentDomain.Load(). Of course, that means the new appdomain will have to load the assembly that contains the definition of the class containing the delegate, so hopefully that's acceptable.
Ken
"Sunny" <su***@newsgroups.nospam> wrote in message news:e$**************@TK2MSFTNGP09.phx.gbl... Hi Ken,
just curious (never had to deal with this) - how the you load an assembly in the new appdomain without loading it in the calling one?
Sunny
In article <ui**************@tk2msftngp13.phx.gbl>, ken.kolda@elliemae- nospamplease.com says... When you call AppDomain.Load() from a different AppDomain than the one in which the assembly is loaded, you can often run into this problem. What's happened is the assembly is indeed loaded into the other app domain. But, it then attempts to return the assembly reference to the calling AppDomain. That requires the calling AppDomain to load the assembly as well. But, since the assembly isn't in the calling AppDomain's probing path (current directory), the load fails.
Ken
"A. Elamiri" <abdellahDOTelamiriATclintonDOTedutNOSPAM> wrote in message news:%2******************@TK2MSFTNGP12.phx.gbl... > Thanks for the replies, but now I'm getting a different error > > Additional information: Insufficient state to deserialize the object. More > information is needed. > > this occurs at this line > OwnerForm.SvcBin.Load("ClintonServices"); > > SvcBin is an AppDomain created by the OwnerForm, OwnerForm is simply the > parent windows form > > > -- > Abdellah Elamiri > .net Developer > Efficacy through simplicity > "Abhishek Srivastava" <ab******@nospam.net> wrote in message > news:uK**************@TK2MSFTNGP12.phx.gbl... > > In the code you have posted you have created the domain. but you haven't > > loaded the assembly yet. > > > > On the created domain you should call Load and pass the assembly which you > > are trying to load as a param. > > > > This time you don't have to pass any path information because that was > > already supplied to the AppDomainSetup object. > > > > regards, > > Abhishek. > > > > "A. Elamiri" <abdellahDOTelamiriATclintonDOTedutNOSPAM> wrote in message > > news:OE**************@TK2MSFTNGP11.phx.gbl... > > > 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 assembly to run (scheduler). > > > > > > I created a seperate AppDomain here is the code: > > > ... > > > AppDomainSetup ads = new AppDomainSetup(); > > > string path = > > > > > > Application.ExecutablePath.Replace(System.IO.Path. GetFileName(Application.Ex > > > ecutablePath),""); > > > ads.ApplicationBase = path + "Services"; > > > ads.PrivateBinPathProbe = path + "Services"; > > > ads.PrivateBinPath = path + "Services"; > > > ads.DisallowBindingRedirects = true; > > > Tools.ShowInfo(path); > > > SvcBin = AppDomain.CreateDomain("ServiceAssemblies",null,ad s); > > > > > > ... > > > > > > The above code was placed in the constructor. When I look through the > > > assemblies (GetAssemblies) to see a listing of all classes loaded, I > don't > > > see the classes in the dll located in that services folder, which made > me > > > think that it is not being probed. Anything I'm doing wrong? > > > -- > > > Abdellah Elamiri > > > .net Developer > > > Efficacy through simplicity > > > > > > > > > > > > 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: stu_pb |
last post by:
I am designing a plugin system for a window application using .NET(C#
specifically). One of the requirements of the plugin system is to be able to
dynamically load/unload plugins.
My initial...
|
by: BuddyWork |
last post by:
I think I've found a possible issue with .Net AppDomain.Unload when
using attribute LoaderOptimization.MultiDomain.
Here you will need ProcessExplorer from SysInternals to see what
assemblies...
|
by: Tyrven |
last post by:
I have a localized website that has been in production for sometime.
Recently, localizations for one particularly locale (zh-TW) stopped
displaying on the test application; the same locale works...
|
by: Benny Raymond |
last post by:
What should I do instead of this:
AppDomain.CurrentDomain.AppendPrivatePath(Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath)
+ @"\plugins");
now that...
|
by: =?Utf-8?B?SmFu?= |
last post by:
I have a .NET 2.0 application divided in two assemblies; the exe and a dll.
The application generates a plugin-dll which is then loaded in a separate
AppDomain (along with a second instance of my...
|
by: =?Utf-8?B?U3RlZmFuIEJhcmxvdw==?= |
last post by:
This has been working perfectly for months. Since we switched from ASP.NET
1.1 to 2.0, we have constant and sporadic issues with updating our
applications.
Touching the web.config works about...
|
by: Boni Lopez |
last post by:
Hi there,
Supposed I have loaded into an current domain an assembly myasm.dll
i.e. Appdomain.CurrentDomain.Load(bytes_of_myasm.dll)
myasm.dll is signed and has a strong name
Now I have a...
|
by: illegal.prime |
last post by:
Hi all, I'm getting unexpected results when trying to preload
assemblies into an AppDomain I'm creating. Upon creation of the
AppDomain - I attach an AssemblyResolve to both my current AppDomain...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
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
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
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...
|
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: 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: 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,...
|
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...
| |