我在MS Report Viewer版本10上安裝了一個Regshot diff來找到密鑰,因爲這裏發佈的其他人都沒有工作。
Here is the actual diff results在新鮮的Windows服務器虛擬機上。
不管怎麼說,我發現這個版本的關鍵是:
SOFTWARE\Wow6432Node\Microsoft\ReportViewer\v10.0
的代碼我使用:
public bool IsInstalledReportViewer()
{
try
{
RegistryKey registryBase = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, string.Empty);
if (registryBase != null)
{
// check the two possible reportviewer v10 registry keys
return registryBase.OpenSubKey(@"Software\Microsoft\ReportViewer\v2.0.50727") != null
|| registryBase.OpenSubKey(@"Software\Wow6432Node\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx\ReportViewer v10") != null
|| registryBase.OpenSubKey(@"SOFTWARE\Wow6432Node\Microsoft\ReportViewer\v10.0") != null;
}
}
catch (Exception ex)
{
Debug.WriteLine(ex);
// put proper exception handling here
}
return false;
}
這是建在彙報的東西?如果是這樣,你爲什麼需要知道它的安裝?您可以將其dll與您的應用程序並排分發。一些req dll在GAC中,但您可以輕鬆地將它們取出。 – cjb110
是的,但我想讓應用程序無法在計算機上自行安裝,因爲我使用它來安裝另一個應用程序。因此最終生病在電腦上有2個應用程序,其中一個沒有做任何事情(僅在應用程序安裝時使用) – Ruan
正如我所說的,它們與SxS一起使用,並排部署,因此您可以將它們全部放入該文件夾旁邊的應用程序...沒有這樣的安裝。 – cjb110