简体   繁体   English

如何在 IIS 中使用外部库部署应用程序

[英]How to deploy an app using external libraries In IIS

This is my first time using IIS so I don't know much about how it works.这是我第一次使用 IIS,所以我不太了解它是如何工作的。

I developed an ASP.net c# web form app, in order to deploy it on a server using IIS.我开发了一个 ASP.net c# web 表单应用程序,以便使用 IIS 在服务器上部署它。 I had Visual Studio installed on the windows server, to make sure the app works fine, no problems up to this point.我在 Windows 服务器上安装了 Visual Studio,以确保应用程序正常工作,到目前为止没有问题。

When I publish the app from visual studio, and put the file system generated inside inetpub/wwwroot... the pages load fine but just when a I try feature of the app that needs an external library, an exception is raised exactly in the line where the first external library's object instaciated within the code (Information givven by the log).当我从 Visual Studio 发布应用程序,并将生成的文件系统放在 inetpub/wwwroot 中时……页面加载正常,但就在我尝试需要外部库的应用程序功能时,恰好在该行中引发异常第一个外部库的对象在代码中固定的位置(日志提供的信息)。

I'm suspecting that once deployed on IIS app has no reference for the libraries or doesn't have the rights to access them since I haven't touched anything inside IIS besides adding the file system to the depault app pool.我怀疑一旦部署在 IIS 应用程序上就没有库的参考或没有访问它们的权利,因为除了将文件系统添加到 depault 应用程序池之外,我还没有触及 IIS 内部的任何内容。 But how can I adress this issue?但是我该如何解决这个问题呢?

Here are the two errors traces I got from my log :这是我从日志中得到的两个错误跟踪:

Retrieving the COM class factory for component with CLSID {ED0EC116-16B8-44CC-A68A-41BF6E15EB3F} failed due to the following error : 80070154 Class not registred (Exception  HRESULT : 0x80040154 (REGDB_E_CLASSNOTREG)).

Or Other Times:或其他时间:

Retrieving the COM class factory for component with CLSID  {00024500-0000-0000-C000-000000000046} failed due to the following error : 80070005 Access Denied. (Exception  HRESULT : 0x80070005 (E_ACCESSDENIED)).

Thanks in advance.提前致谢。

The application is run on IIS base on the pool that you have assign it to it.该应用程序基于您分配给它的池在 IIS 上运行。 This pool is run under a specific account.此池在特定帐户下运行。

So add this account to the DCOM Config to been able to access it.因此,将此帐户添加到 DCOM 配置以便能够访问它。

First step is to find your pool user as.第一步是找到您的池用户。

Then add permissions for that user on your DCOM Applications so the pool can read them and run them.然后在您的 DCOM 应用程序上为该用户添加权限,以便池可以读取它们并运行它们。

To find the DCOM Config, go to要查找 DCOM 配置,请转到

Control Panel | Administrative Tools | Component Services

Then open然后打开

Component Services | Computers | My Computer | DCOM Config

There find your applications that you use, left click to open the menu and select properties... there give permissions to your Pool user在那里找到您使用的应用程序,左键单击打开菜单并选择属性...那里授予您的 Pool 用户权限

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM