public static string GetShortPathName(string fullPath) { var shortPath = new StringBuilder(Constants.Path.MaxPath, Constants.Path.MaxPath); if (GetShortPathName(fullPath, shortPath, Constants.Path.MaxPath) == 0) { throw new COMException(StringResourceManager.Format(Resources.Exceptions.FilePathShortPathName, fullPath), Marshal.GetLastWin32Error()); } return(shortPath.ToString()); }
public bool InstallAssemblyFile(string filePath) { if (filePath == null) { throw new ArgumentNullException("filePath"); } if (!File.Exists(filePath)) { throw new FileNotFoundException(StringResourceManager.Format(Resources.Exceptions.GacUtilAssemblyFileNotFound, filePath), filePath); } return(GAC.InstallAssembly((uint)IASSEMBLYCACHE_INSTALL_FLAG.IASSEMBLYCACHE_INSTALL_FLAG_FORCE_REFRESH, filePath, null) == 0); }