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