2014-04-04 144 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" %> 
相關問題