访问Web服务时编译ASMX时出错

时间:2010-09-09 16:45:14

标签: asp.net

我有一个ASMX网络服务。当我从客户端访问它时,ASMX被编译但我收到此错误:

从错误详细信息查看csc.exe命令行,未引用System.Windows.Forms asseembly。

编译错误


描述:编译服务此请求所需的资源时发生错误。请查看以下特定错误详细信息并相应地修改源代码。

Compiler Error Message: CS0234: The type or namespace name 'Windows' does not exist in the namespace 'System' (are you missing an assembly reference?)

Source Error:

Line 3:  using System.ComponentModel;
Line 4:  using System.Drawing;
Line 5:  using System.Windows.Forms;
Line 6:  using System.Xml;
Line 7:  using Idp.Core.Configuration;

1 个答案:

答案 0 :(得分:0)

出现此问题至少有两个原因:

  1. 项目未引用所需的程序集(在本例中为System.Windows.Forms)。您可以通过在Visual Studio中添加对项目的引用来解决此问题,并在需要时重新部署站点。
  2. 使用声明是多余的。有时我最终会在我的文件中使用不需要的使用语句。如果它未使用,删除第5行应该可以解决问题。