我使用C#.NET开发了一个Windows服务来生成PDF报告.要生成PDF文件,我使用的是第三方dll.该应用程序在我的Windows XP平台上运行.当我在Windows Server 2008 64位版本中部署该服务时,我收到此错误:
由于以下错误,检索具有CLSID {46521B1F-0A5B-4871-A4C2-FD5C9276F4C6}的组件的COM类工厂失败:80040154.
我使用regsvr32命令注册了DLL.我能够在注册表中看到这个CLSID.但问题仍然存在.
可能是什么问题呢?
尝试在当前计算机上获取应用程序池时,我遇到了一个奇怪的问题.似乎在安装IISExpress时,除了完整的IIS之外,Microsoft代码还要检查IISExpress.IISExpress为每个用户使用单独的applicationHost文件.我不确定这个电话是否会要求它检查所有这些,或者只是当前用户的那些.无论如何,它找不到它在'C:\ Windows\system32\config\systemprofile \'目录中寻找的那个.对于正在运行此代码的应用程序池运行的用户,应该转到%userprofile%或'C:\ Users\Administrator \'.
有谁知道这个systemprofile目录可能来自哪里?
Exception:-
System.IO.DirectoryNotFoundException: Filename: \\?\C:\Windows\system32\config\systemprofile\Documents\IISExpress\config\applicationHost.config
Error: Cannot read configuration file
at Microsoft.Web.Administration.Interop.AppHostWritableAdminManager.GetAdminSection(String bstrSectionName, String bstrSectionPath)
at Microsoft.Web.Administration.Configuration.GetSectionInternal(ConfigurationSection section, String sectionPath, String locationPath)
at Microsoft.Web.Administration.ServerManager.get_ApplicationPoolsSection()
at Microsoft.Web.Administration.ServerManager.get_ApplicationPools()
at CustomCode.Classes.IIsApplicationPool.GetApplicationPool(String iisWebSitePath, String poolName)
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用ServerManager.OpenRemote(来自Microsoft.Web.Administration),但无法找到有关如何从当前用户提供不同凭据的文档.我尝试过SimpleImpersonation(来自你如何在.NET中进行模拟?)它给了我同样的错误:
System.UnauthorizedAccessException - 由于以下错误,从机器[...]检索具有CLSID {2B72133B-3F5B-4602-8952-803546CE3344}的远程组件的COM类工厂失败:80070005 [...]."
远程计算机上的防火墙已关闭.UAC已禁用.