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