private void SignBrowseForKeyFile()
        {
            string filePath = AppService.UI.ShowOpenFileDialog(
                Constants.StrongNameKeyFileFilter,
                SR.OpenFileCaption);

            if (string.IsNullOrEmpty(filePath))
            {
                return;
            }

            if (!File.Exists(filePath))
            {
                return;
            }

            string password = null;

            if (StrongNameUtils.IsPKCS12File(filePath))
            {
                if (!StrongNamePasswordCache.TryGet(filePath, out password))
                {
                    return;
                }
            }

            _projectSign.KeyFile  = filePath;
            _projectSign.Password = password;
            OnPropertyChanged("SignKeyFile");
            OnProjectChanged();
        }
예제 #2
0
        private void LoadStrongName(MSBuildAssembly assembly, Build.Project project, string projectFolder)
        {
            string keyFile  = GetKeyFile(project, projectFolder);
            string password = null;

            if (StrongNameUtils.IsPKCS12File(keyFile))
            {
                if (!StrongNamePasswordCache.TryGet(keyFile, out password))
                {
                    return;
                }
            }

            assembly.Sign        = true;
            assembly.DelaySign   = IsDelaySign(project);
            assembly.KeyFilePath = keyFile;
            assembly.KeyPassword = password;
        }