asp.net - CS0103 : The name 'Encoding' does not exist in the current context

标签 asp.net asp.net-3.5

我有一个在框架 3.5 上运行的 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



Google 指出应用程序可能针对框架的客户端版本或系统缺少 system.web dll。

我已经检查过这两种可能性都不是原因......有什么想法吗?

最佳答案

尝试使用命名空间
使用 System.Text;

关于asp.net - CS0103 : The name 'Encoding' does not exist in the current context,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22860782/

相关文章:

c# - DLL 比较以确认是否使用相同的源代码

c# - 为什么我的 SqlCacheDependency HasChanged 返回 false 但几乎是在更改为 true 之后立即返回?

.net - 替代 ASP.NET 中的 Page_Load(以及一个很好的 WTF 故事)

asp.net - 在调用 "WebSecurity.InitializeDatabaseConnection"类的任何其他方法之前,必须先调用 "WebSecurity"方法

c# - 如何在 ASP.NET MVC 站点中实现速率限制?

c# - 如何在 EnumMember 属性中添加多个值?

javascript - 如何使用JavaScript或Jquery选择在GridView中选中的行项的子项?

asp.net-mvc-3 - 性能瓶颈 Url.Action - 我可以解决它吗?

c# - 如何在生产中捕获 HttpRequestValidationException

c# - 我如何将时间跨度转换为 double 值