caolijun0359 发表于 2008-3-27 16:32:00

Web端实现在服务器上启动CAD IAcadApplication问题

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IAcadApplication app1=Server.CreateObject(("AutoCAD.Application")) as IAcadApplication;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IAcadApplication app2 = new AcadApplicationClass();<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; app1.Quit();<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; app2.Quit();</p><p>我建了一个aps页面,添加了一个服务器端的button,在单击事件里面添加了上面的代码(通过两种方式创建IAcadApplication对象),在c/s方式下是可以的,web下在调试状态下也可以,但是用IIS发布以后就提示错误,错误信息如下:</p><p>“/cad”应用程序中的服务器错误。<br/>-----------------------------------------------------------------<br/>未能创建类型为“AutoCAD.Application”的对象。 <br/>说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 </p><p>异常详细信息: System.Web.HttpException: 未能创建类型为“AutoCAD.Application”的对象。</p><p>源错误: <br/>行 18:&nbsp;&nbsp;&nbsp;&nbsp; protected void Button1_Click(object sender, EventArgs e)<br/>行 19:&nbsp;&nbsp;&nbsp;&nbsp; {<br/>行 20:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IAcadApplication app1=Server.CreateObject(("AutoCAD.Application")) as IAcadApplication;<br/>行 21:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IAcadApplication app2 = new AcadApplicationClass();<br/>行 22:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; app1.Quit();<br/>源文件: d:\WebSite1\Default.aspx.cs&nbsp;&nbsp;&nbsp; 行: 20 <br/>堆栈跟踪: <br/><br/>&nbsp;&nbsp; System.Web.HttpServerUtility.CreateObject(String progID) +3181904<br/>&nbsp;&nbsp; _Default.Button1_Click(Object sender, EventArgs e) in d:\WebSite1\Default.aspx.cs:20<br/>&nbsp;&nbsp; System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105<br/>&nbsp;&nbsp; System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107<br/>&nbsp;&nbsp; System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7<br/>&nbsp;&nbsp; System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11<br/>&nbsp;&nbsp; System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33<br/>&nbsp;&nbsp; System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102<br/>--------------------------------------------------------------------------------<br/>版本信息: Microsoft .NET Framework 版本:2.0.50727.42; ASP.NET 版本:2.0.50727.42 </p>
页: [1]
查看完整版本: Web端实现在服务器上启动CAD IAcadApplication问题