/
aprogrammer
/
dotnet-docs
Обзор
Документация
Войти
/
aprogrammer
/
dotnet-docs
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
samples/snippets/cpp/VS_Snippets_CLR/AppDomain_Setup/CPP/source3.cpp
34 строки
1 KB
Andy De George
Move snippets from samples repo to this repo (#17296)
03 мар 2020, 19:23
Не верифицирован
03 мар 2020, 19:23
dbbeda1
Код
Авторство
О чём код?
//<snippet3> using namespace System; using namespace System::Reflection; ref class AppDomain5 { public: static void Main() { // Application domain setup information. AppDomainSetup^ domaininfo = gcnew AppDomainSetup(); domaininfo->ApplicationBase = "f:\\work\\development\\latest"; domaininfo->ConfigurationFile = "f:\\work\\development\\latest\\appdomain5.exe.config"; // Creates the application domain. AppDomain^ domain = AppDomain::CreateDomain("MyDomain", nullptr, domaininfo); // Write the application domain information to the console. Console::WriteLine("Host domain: " + AppDomain::CurrentDomain->FriendlyName); Console::WriteLine("Child domain: " + domain->FriendlyName); Console::WriteLine(); Console::WriteLine("Application base is: " + domain->SetupInformation->ApplicationBase); Console::WriteLine("Configuration file is: " + domain->SetupInformation->ConfigurationFile); // Unloads the application domain. AppDomain::Unload(domain); } }; int main() { AppDomain5::Main(); } //</snippet3>