IIS Varsayılan Web Sitesi'ni durduran uygulama oluşturuyorum. Web sitesini durdurmak için bir PowerShell betiği kullandım çünkü bu betik web sitemden yürütülür. CLSID {688EEEE5-6A7E-422F-B2E1-6AF00DC944A6} bileşenine ait COM sınıfı fabrikasının geri alınması başarısız oldu
Bu
benim senaryom:Import-Module C:\Windows\System32\WindowsPowerShell\v1.0\Modules\WebAdministration
Stop-Website 'Default Web Site'
my copy code
Start-Website 'Default Web Site'
Ve bu benim C# kodu:
PowerShell _PowerShell = PowerShell.Create();
Runspace rs = RunspaceFactory.CreateRunspace();
rs.Open();
_PowerShell.Runspace = rs;
_PowerShell.AddScript(@"Set-ExecutionPolicy RemoteSigned -scope LocalMachine").Invoke();
_PowerShell.AddScript(@"E:\DE.TEST\Power_Shell\Scripts\StopIISDefaultSite.ps1").Invoke();
if (_PowerShell.HadErrors)
{
Collection<ErrorRecord> errors = _PowerShell.Streams.Error.ReadAll();
foreach (var item in errors)
{
Console.WriteLine(item.ToString());
}
}
Console.ReadLine();
O
Retrieving the COM class factory for component with CLSID {688EEEE5-6A7E-422F-B2E1-6AF00DC944A6} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
Herhangi bir CPU kullanıyorum. powershell'de usta değilim :( –
ix86 olarak değiştiriyorum hala hata oluşuyor –
net olarak o makinede kayıtlı olmayan bir şey (yani kodun buna karşı çalıştırılması için kaydolması gereken COM bileşeni) –