现在我把其中两个com组件都引用到了程序中,包括app.config文件.
代码如下:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using Client;
using General;
namespace WebQt
{
/// <summary>
/// WebForm1 的摘要说明。
/// </summary>
public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.TextBox TextBox1;
public string str;
private void Page_Load(object sender, System.EventArgs e)
{
Client.CJoinProtectMan  joinman = new CJoinProtectMan(); joinman.InitObject("0000");

int n_str = joinman.NewJoinProtectMan(out str); this.TextBox1.Text = str.ToString();
} #region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{    
this.Load += new System.EventHandler(this.Page_Load); }
#endregion
}
}

解决方案 »

  1.   

    总是报错:
    因发生异常 System.IO.FileNotFoundException: 系统找不到指定的文件。 at System.IConfigHelper.Run(IConfigHandler factory, String fileName) at System.ConfigTreeParser.Parse(String fileName, String configPath) 而无法成功读取 .Config 文件 app.config。 
    说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.Runtime.Remoting.RemotingException: 因发生异常 System.IO.FileNotFoundException: 系统找不到指定的文件。 at System.IConfigHelper.Run(IConfigHandler factory, String fileName) at System.ConfigTreeParser.Parse(String fileName, String configPath) 而无法成功读取 .Config 文件 app.config。源错误: 
    行 26:  Client.CJoinProtectMan  joinman = new CJoinProtectMan();
    行 27: 
    行 28:  joinman.InitObject("9999");
    行 29: 
    行 30:  int n_str = joinman.NewJoinProtectMan(out str);
     
      

  2.   

    我把app.config文件放在了应用程序中,甚至引用到应用程序中,还是不可以.吐血....
      

  3.   

    请问楼主为什么要把Remoting封装成COM?