-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathUtils.cs
38 lines (34 loc) · 1.51 KB
/
Utils.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using System;
using System.Reflection;
namespace Sandbox
{
internal class Utils
{
public static void PrintAppDomainInfo(Type codeLayerType)
{
Console.WriteLine("===========================================================");
var currentDomain = AppDomain.CurrentDomain;
Console.WriteLine("Info about \"{0}\" domain:", currentDomain.FriendlyName);
Console.WriteLine("\tIs Fully Trusted: {0}", currentDomain.IsFullyTrusted);
var codeLayer = codeLayerType.IsSecurityTransparent ? "Transparent" :
codeLayerType.IsSecuritySafeCritical ? "SafeCritical" : "Critical";
Console.WriteLine("\tCode in \"{0}\" class belong to {1} layer", codeLayerType.Name, codeLayer);
var assemblies = currentDomain.GetAssemblies();
if (assemblies.Length == 0)
{
Console.WriteLine("\tNo assemblies loaded in this domain.");
}
else
{
Console.WriteLine("\t{0} assemblies loaded in this domain.", assemblies.Length);
foreach (var assembly in assemblies)
{
var simpleName = new AssemblyName(assembly.FullName).Name;
Console.WriteLine("\t\"{0}\" Is Fully Trusted: {1}", simpleName, assembly.IsFullyTrusted);
}
}
Console.WriteLine("===========================================================");
Console.WriteLine();
}
}
}