Exemplo n.º 1
0
        private static Assembly LoadFromFabricCodePath(object sender, ResolveEventArgs args)
        {
            string assemblyName = new AssemblyName(args.Name).Name;

            if (!ResolvableAssemblyNames.Contains(assemblyName))
            {
                return(null);
            }

            if (CachedAssemblies.ContainsKey(assemblyName))
            {
                return(CachedAssemblies[assemblyName]);
            }

            try
            {
                string folderPath   = FabricEnvironment.GetCodePath();
                string assemblyPath = Path.Combine(folderPath, assemblyName + ".dll");
                if (File.Exists(assemblyPath))
                {
                    CachedAssemblies[assemblyName] = Assembly.LoadFrom(assemblyPath);
                    return(CachedAssemblies[assemblyName]);
                }
            }
            catch (Exception)
            {
                // Supress any Exception so that we can continue to
                // load the assembly through other means
            }

            return(null);
        }
        public static Assembly ResolveAssembly(string assemblyName)
        {
            if (!KnownDlls.Contains(assemblyName))
            {
                throw new ArgumentException("Unknown fabric assembly name: " + assemblyName, "assemblyName");
            }

            string assemblyPath = Path.Combine(FabricEnvironment.GetCodePath(), assemblyName);

            return(Assembly.LoadFrom(assemblyPath));
        }
Exemplo n.º 3
0
 public static void SetFabricCodePath(string codePath, string machineName)
 {
     Utility.WrapNativeSyncInvoke(() => FabricEnvironment.SetFabricCodePathHelper(codePath, machineName), "FabricEnvironment.SetFabricCodePath");
 }
Exemplo n.º 4
0
 public static void SetFabricBinRoot(string binRoot, string machineName)
 {
     Utility.WrapNativeSyncInvoke(() => FabricEnvironment.SetFabricBinRootHelper(binRoot, machineName), "FabricEnvironment.SetBinRoot");
 }
Exemplo n.º 5
0
 public static string GetLogRoot(string machineName)
 {
     return(Utility.WrapNativeSyncInvoke(() => FabricEnvironment.GetLogRootHelper(machineName), "FabricEnvironment.GetLogRoot"));
 }
Exemplo n.º 6
0
 public static string GetCodePath(string machineName)
 {
     return(Utility.WrapNativeSyncInvoke(() => FabricEnvironment.GetCodePathHelper(machineName), "FabricEnvironment.GetCodePath"));
 }
Exemplo n.º 7
0
 public static bool GetEnableCircularTraceSession(string machineName)
 {
     return(Utility.WrapNativeSyncInvoke(() => FabricEnvironment.GetEnableCircularTraceSessionHelper(machineName), "FabricEnvironment.GetEnableCircularTraceSession"));
 }
Exemplo n.º 8
0
 public static void SetIsSFVolumeDiskServiceEnabled(bool isSFVolumeDiskServiceEnabled, string machineName)
 {
     Utility.WrapNativeSyncInvoke(() => FabricEnvironment.SetIsSFVolumeDiskServiceEnabledHelper(isSFVolumeDiskServiceEnabled, machineName), "FabricEnvironment.SetIsSFVolumeDiskServiceEnabled");
 }
Exemplo n.º 9
0
 internal static LinuxPackageManagerType GetLinuxPackageManagerType()
 {
     return(Utility.WrapNativeSyncInvokeInMTA(() => FabricEnvironment.GetLinuxPackageManagerTypeHelper(), "FabricEnvironment.GetLinuxPackageManagerType"));
 }
Exemplo n.º 10
0
 public static void SetEnableUnsupportedPreviewFeatures(bool enableUnsupportedPreviewFeatures, string machineName)
 {
     Utility.WrapNativeSyncInvoke(() => FabricEnvironment.SetEnableUnsupportedPreviewFeaturesHelper(enableUnsupportedPreviewFeatures, machineName), "FabricEnvironment.SetEnableUnsupportedPreviewFeatures");
 }
Exemplo n.º 11
0
 public static void SetEnableCircularTraceSession(bool enableCircularTraceSession, string machineName)
 {
     Utility.WrapNativeSyncInvoke(() => FabricEnvironment.SetEnableCircularTraceSessionHelper(enableCircularTraceSession, machineName), "FabricEnvironment.SetEnableCircularTraceSession");
 }
Exemplo n.º 12
0
 public static void SetSfInstalledMoby(string fileContents)
 {
     Utility.WrapNativeSyncInvoke(() => FabricEnvironment.SetSfInstalledMobyHelper(fileContents), "FabricEnvironment.SetSfInstalledMoby");
 }