14

I have a webapplication running on framework 3.5 and is installed on multiple clients, working perfectly.

Except this one client... where all webservices that the application provide fail with the following error message:

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 points me toward the application might be targeting the client version of the framework or the system missing the system.web dll.

I've checked that both this possibilities are not the cause... Any ideas?

Sergio
  • 8,125
  • 10
  • 46
  • 77

3 Answers3

57

Try to use the namespace using System.Text;

user3925123
  • 579
  • 4
  • 3
3

Check your web.config for any <clear /> elements for the namespaces. Also, check your App Pool settings. If possible, can you create a new App Pool and try again?

Raja Nadar
  • 9,409
  • 2
  • 32
  • 41
  • for me there was a webconfig under one of the folders and that one had the clear in the namespaces. Thanks. – Crick3t Oct 24 '19 at 12:19
1

I was able to fix this by locating the DefaultWsdlHelpGenerator.aspx file at the specified path and adding this to the Imports at the top:

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

In my case, I was also seeing a similar error about HtmlUtility not existing, which I was able to fix by adding:

<%@ Import Namespace="System.Web" %>
JLRishe
  • 99,490
  • 19
  • 131
  • 169