now that AppDomain.CurrentDomain.AppendPrivatePath is depreciated?
I've lobbied (unsuccessfully) for this API to remain as I use it in v1.1.
"Benny Raymond" <be...@pocketrocks.com> wrote in message
news:%23EVj6Yi...@TK2MSFTNGP10.phx.gbl...
I changed my main form so that it loads up as a stub executable, so my
exe ends up being really small and just consists of this:
namespace APPNAME
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
AppDomainSetup setup = new AppDomainSetup();
setup.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory;
setup.PrivateBinPath = @"\,\Plugins";
setup.ApplicationName = "APPNAME";
AppDomain appDom =
AppDomain.CreateDomain("APPNAME",null,setup);
appDom.CreateInstanceFromAndUnwrap("APPNAME.Container.dll",
"APPNAME.Container.Program");
}
}
}
then, I start buliding my app as normal within the APPNAME.Container dll
- instead of your normal program.cs file it ends up looking something
like this:
namespace APPNAME.Container
{
[Serializable]
class Program
{
public Program()
{
Application.Run(new Form1());
}
}
}
~Benny
The <probing> element adds subdirectories to the search path.
Your .config file will have a section that looks like this...
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="bin;bin2\subbin;bin3"/>
</assemblyBinding>
</runtime>
</configuration>
where each path component is a subdirectory under the application base
directory; delimit each relative path with a semi-colon. The paths are all
relative to the base directory.
This has a similar effect to adding these subdirectories using the
AppendPrivateBinPath API.
"Benny Raymond" <be...@pocketrocks.com> wrote in message
news:Oknjrkr9...@TK2MSFTNGP11.phx.gbl...
setup.PrivateBinPath = @"\,\Plugins";
does not appear correct. Each separate relative path should be delimited
with a semi-colon, not a comma, and the relative path "\" does nothing so
far as I can tell. Also, you do not need to pre-pend a leading backslash. I
think you could replace that LOC with this...
setup.PrivateBinPath = @"Plugins";
Also, if the only thing your loader does is specify a relative search path
you could more easily add a <probing> element (see my other reply) to you
app.config file and not need the loader at all.
"Benny Raymond" <be...@pocketrocks.com> wrote in message
news:ulKzz6p9...@TK2MSFTNGP14.phx.gbl...