// ===++===
//
// OrtizOL
//
// ===--===
/*============================================================
//
// Clase: NuevoAppDomain.cs
//
// Propósito: Demostrar el uso de detalles adicionales para
// la creación de un dominio de aplicación.
//
============================================================*/
using System;
using System.Reflection;
namespace Recetas.Cap03
{
internal class NuevoAppDomain
{
public static void Main()
{
// Creamos un objeto AppDomainSetup para establecer
// los parámetros de ajuste del dominio de aplicación:
AppDomainSetup ajustesAppDomain = new AppDomainSetup();
// Parametrización del dominio de aplicación:
ajustesAppDomain.ApplicationBase = @"X:\DirectorioBase";
ajustesAppDomain.ConfigurationFile = "AppConfig.config";
ajustesAppDomain.PrivateBinPath = "bin;addons;recursos";
// Creamos un nuevo dominio sin restricciones de acceso
// (con el argumento Evidence valor null).
AppDomain nuevoAppDomain = AppDomain.CreateDomain("Nuevo AppDomain", null, ajustesAppDomain);
Console.WriteLine("\nDominio anfitrión: {0}", AppDomain.CurrentDomain.FriendlyName.ToString());
Console.WriteLine("Dominio huésped: {0}\n", nuevoAppDomain.FriendlyName.ToString());
}
}
}
Ly8gPT09Kys9PT0KLy8KLy8gICAgT3J0aXpPTAovLwovLyA9PT0tLT09PQovKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQovLwovLyBDbGFzZTogTnVldm9BcHBEb21haW4uY3MKLy8KLy8gUHJvcMOzc2l0bzogRGVtb3N0cmFyIGVsIHVzbyBkZSBkZXRhbGxlcyBhZGljaW9uYWxlcyBwYXJhIAovLyBsYSBjcmVhY2nDs24gZGUgdW4gZG9taW5pbyBkZSBhcGxpY2FjacOzbi4KLy8KPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KCnVzaW5nIFN5c3RlbTsKdXNpbmcgU3lzdGVtLlJlZmxlY3Rpb247CgpuYW1lc3BhY2UgUmVjZXRhcy5DYXAwMwp7CiAgICBpbnRlcm5hbCBjbGFzcyBOdWV2b0FwcERvbWFpbgogICAgewogICAgICAgIHB1YmxpYyBzdGF0aWMgdm9pZCBNYWluKCkKICAgICAgICB7CiAgICAgICAgICAgIC8vIENyZWFtb3MgdW4gb2JqZXRvIEFwcERvbWFpblNldHVwIHBhcmEgZXN0YWJsZWNlciAKICAgICAgICAgICAgLy8gbG9zIHBhcsOhbWV0cm9zIGRlIGFqdXN0ZSBkZWwgZG9taW5pbyBkZSBhcGxpY2FjacOzbjoKICAgICAgICAgICAgQXBwRG9tYWluU2V0dXAgYWp1c3Rlc0FwcERvbWFpbiA9IG5ldyBBcHBEb21haW5TZXR1cCgpOwogICAgICAgICAgICAKICAgICAgICAgICAgLy8gUGFyYW1ldHJpemFjacOzbiBkZWwgZG9taW5pbyBkZSBhcGxpY2FjacOzbjoKICAgICAgICAgICAgYWp1c3Rlc0FwcERvbWFpbi5BcHBsaWNhdGlvbkJhc2UgPSBAIlg6XERpcmVjdG9yaW9CYXNlIjsKICAgICAgICAgICAgYWp1c3Rlc0FwcERvbWFpbi5Db25maWd1cmF0aW9uRmlsZSA9ICJBcHBDb25maWcuY29uZmlnIjsKICAgICAgICAgICAgYWp1c3Rlc0FwcERvbWFpbi5Qcml2YXRlQmluUGF0aCA9ICJiaW47YWRkb25zO3JlY3Vyc29zIjsKICAgICAgICAgICAgCiAgICAgICAgICAgIC8vIENyZWFtb3MgdW4gbnVldm8gZG9taW5pbyBzaW4gcmVzdHJpY2Npb25lcyBkZSBhY2Nlc28gCiAgICAgICAgICAgIC8vIChjb24gZWwgYXJndW1lbnRvIEV2aWRlbmNlIHZhbG9yIG51bGwpLgogICAgICAgICAgICBBcHBEb21haW4gbnVldm9BcHBEb21haW4gPSBBcHBEb21haW4uQ3JlYXRlRG9tYWluKCJOdWV2byBBcHBEb21haW4iLCBudWxsLCBhanVzdGVzQXBwRG9tYWluKTsKICAgICAgICAgICAgCiAgICAgICAgICAgIENvbnNvbGUuV3JpdGVMaW5lKCJcbkRvbWluaW8gYW5maXRyacOzbjogezB9IiwgQXBwRG9tYWluLkN1cnJlbnREb21haW4uRnJpZW5kbHlOYW1lLlRvU3RyaW5nKCkpOwogICAgICAgICAgICBDb25zb2xlLldyaXRlTGluZSgiRG9taW5pbyBodcOpc3BlZDogezB9XG4iLCBudWV2b0FwcERvbWFpbi5GcmllbmRseU5hbWUuVG9TdHJpbmcoKSk7CiAgICAgICAgfQogICAgfQp9