无法从ASP.NET MVC应用程序实例化COM对象 [英] Can't instantiate COM object from ASP.NET MVC app
问题描述
正如标题所说,我想从一个ASP.NET MVC应用程序这样的实例化一个COM对象:
As the title says, I want to instantiate a COM object from an ASP.NET MVC app like this:
dynamic obj = Activator.CreateInstance(Type.GetTypeFromProgID(progID));
但它引发以下收到COMException:
but it throws the following ComException:
与CLSID检索COM类工厂组件
{16542E4F-4594-4B97-922D-BE9C478F93BB}失败,由于以下
错误:从HRESULT 800aea5f例外:0x800AEA5F
Retrieving the COM class factory for component with CLSID {16542E4F-4594-4B97-922D-BE9C478F93BB} failed due to the following error: 800aea5f Exception from HRESULT: 0x800AEA5F.
同样的code从下面的生成配置WinForms应用程序的工作原理:平台:86
和目标平台:86
。
The same code works from a Winforms app with the following build configuration: Platform: x86
and Platform target: x86
.
我设置了构建配置相同,同时为MVC应用程序,并在那里我使用COM对象的组件Winforms应用程序。
I set the build configuration the same as the Winforms app for both the mvc app and the assembly where I use the COM object.
我使用Windows 7,IIS 7.5,ASP.NET v4.0的应用程序池与启用32位应用程序和真实网站有Administator权限的用户下运行。
I'm using Windows 7, IIS 7.5, ASP.NET v4.0 Application Pool with Enable 32-Bit Applications True and the website runs under a user with Administator rights.
你有什么建议,帮助解决这个问题?
What are your suggestions to help solve this problem?
推荐答案
应用程序池的默认用户设置为具有管理员权限的用户
Set the Application Pool's Default User to a user with Admin rights
这篇关于无法从ASP.NET MVC应用程序实例化COM对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!