IIS 笔记

禁用调试

如果安装IIS的机器上也安装了开发环境,可能会在发生异常时,被Just-IN-Time实时调试捕捉,弹窗并等待处理的情况,这种情况下IIS会被无限期停滞在等待处理的状态下,就像是在Vs下运行Debug一样。
image

解决方法设置该站点Web.config中相应配置

<configuration>
	<system.web>
		<compilation debug="false" targetFramework="4.8" />
	</system.web>
</configuration>

修改的方式也有两种:

  1. 直接修改站点目录下Web.config文件,该文件可能从开发环境就有,并随发布后复制而来
  2. 通过 Internet Information Services Manager,修改 IIS-ASP.NET-.NET Compilation-Behavior-Debug,点击Apply生效

Com组件异常

System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {19F37CF2-C7C2-11D0-8714-0020AFEE2C2A} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

asp.net mvc framework 4.8项目,引用com组件waters empower toolkit 2.3 object library,VS2022开发环境调试时正常,组件可实例化、可运行组件方法如下:

using MillenniumToolkit;

var project = new Project();
project.fetch();

发布部署到本机IIS运行,调用接口,引发System.Runtime.InteropServices.COMException,断点跟踪引发异常的语句在实例化

var project = new Project();

处理方法:
如果服务器是64位应用,打开IIS应用程序池高级设置,允许运行32位应用
image

posted @ 2023-08-28 11:28  试试手气  阅读(11)  评论(0编辑  收藏  举报