2014-04-04 145 views
1

我有一个运行在框架3.5上的web应用程序,并安装在多个客户端上,工作正常。CS0103:当前上下文中不存在名称'编码'

除本客户端...其中,该应用程序提供的所有web服务失败,出现以下错误信息:

Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0103: The name 'Encoding' does not exist in the current context

Source Error:

Line 100: string EscapedFileName { Line 101: get { Line 102: return HttpUtility.UrlEncode(FileName, Encoding.UTF8); Line 103: } Line 104: }

Source File: c:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\DefaultWsdlHelpGenerator.aspx Line: 102

谷歌指出我向应用程序可能瞄准的框架或系统的客户端版本缺少system.web dll。

我检查过这两种可能性都不是原因...任何想法?

回答

2

检查您的web.config的任何<clear />命名空间的元素。 另外,请检查您的应用程序池设置。如果可能,你可以创建一个新的应用程序池并重试吗?

+0

+1对于建议,但不幸的是我的问题仍然存在... – Sergio

0

我能够通过在指定的路径定位DefaultWsdlHelpGenerator.aspx文件,并在顶部添加此向进口解决这个问题:

<%@ Import Namespace="System.Text" %> 

在我的情况,我也看到有关类似错误HtmlUtility不存在,我可以通过补充来修复:

<%@ Import Namespace="System.Web" %> 
相关问题