简体   繁体   English

引用COM对象的ASP.Net Core 2.0在本地工作,但在部署时无法工作

[英]ASP.Net Core 2.0 referencing COM objects works locally but not when deployed

I have ASP.Net Core 2.0 MVC app that references several COM objects. 我有引用几个COM对象的ASP.Net Core 2.0 MVC应用程序。 I've referenced the COM objects via Visual Studio's Add Reference process. 我已经通过Visual Studio的“添加引用”过程引用了COM对象。 References show in my solution such as 参考资料显示在我的解决方案中,例如

Interop.XYZ 互操作

VS automatically set the Embed Interop Types to true, as it's supposed to do. VS可以自动将Embed Interop Types设置为true。

The solution builds and runs and I can successfully use the methods in these references locally. 该解决方案可以构建并运行,我可以在本地成功使用这些引用中的方法。

When I publish it to IIS on another machine though I get this error: 当我将其发布到另一台计算机上的IIS时,出现以下错误:

Retrieving the COM class factory for component with CLSID {5D9E1092-69D4-11D2-BCBB-0000E82BB3D3} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)). 由于以下错误,检索具有CLSID {5D9E1092-69D4-11D2-BCBB-0000E82BB3D3}的组件的COM类工厂失败:80040154未注册类(HRESULT的异常:0x80040154(REGDB_E_CLASSNOTREG))。

My app pool has Enable 32 Bit Applications set to true. 我的应用程序池将“启用32位应用程序”设置为true。 In my Project Properties, Platform target is set to Any CPU (I tried forcing it to x86 and the site won't even run on IIS after publishing). 在我的项目属性中,平台目标设置为任何CPU(我尝试将其强制为x86,并且发布后该站点甚至无法在IIS上运行)。

I made a clone of the app using .Net 4.7 and configured it the same way, using the same COM references, and published to a second site on the same server. 我使用.Net 4.7克隆了该应用程序,并使用相同的COM引用以相同的方式对其进行了配置,然后将其发布到同一服务器上的另一个站点。 The published version of that app works fine so I don't think it's an issue with the assemblies not being registered (should't be in any case since Embed Interop Types is true for all the COM referenes). 该应用程序的发布版本运行良好,因此我认为这与未注册程序集无关(在任何情况下都不会出现此问题,因为Embed Interop Types对于所有COM参照都是正确的)。

Anybody know what's going on? 有人知道发生了什么吗?

Not sure of this is related, but there is another question with a similar message and with an answer. 不确定是否与此相关,但是还有另一个问题,该问题带有类似的消息和答案。

Here is the link: 链接在这里:

Link 链接

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ASP.NET Core(HttpSys)路由在本地工作,但在部署时不工作 - ASP.NET Core (HttpSys) Routing works locally but not when deployed 仅在 UAT web 服务器中部署时出现路由错误 404。 在当地工作。 ASP.NET核心 - Routing error 404 only when deployed in UAT web server. Works locally. ASP.NET Core ASP.Net Core Web API 适用于 IIS Express,但在部署到 IIS 时不起作用 - ASP.Net Core Web API works on IIS Express, but not working when deployed to IIS ASP.NET 核心 gRPC 在本地工作但不在 Docker - ASP.NET Core gRPC works locally but not in Docker ASP.NET核心集成测试在本地工作,但在生产环境中运行时会抛出空引用异常 - ASP.NET Core Integration Test works locally but throws null reference exception when running in production environment 发布时从另一个ASP.NET Core 2项目引用ASP.NET Core 2项目失败 - Referencing ASP.NET Core 2 project from another ASP.NET Core 2 project fails when publishing ASP.NET MVC5 Google API GoogleWebAuthorizationBroker.AuthorizeAsync在本地工作,但未部署到IIS - ASP.NET MVC5 Google APIs GoogleWebAuthorizationBroker.AuthorizeAsync works locally but not deployed to IIS ASP.Net 页面在本地工作但在推送到服务器时失败 - ASP.Net Page Works Locally But Fails When Pushed To Server Angular 8 - 路由在本地工作,但在生产环境中部署时,路由不起作用 - .NET 核心 C# 后端 - Angular 8 - routing works locally, but when deployed on Production, routes don't work - .NET Core C# backend 从ASP.Net Core 1.1迁移到2.0时BadImageFormatException - BadImageFormatException when migrating from ASP.Net Core 1.1 to 2.0
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM