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?
CS0103 is caused when you are using a name for a variable or method that does not exist within the context that you are using it. In order to fix the CS0103 error you will need to correct the name of the variable or method from where it is declared or referenced.
Many a times while writing a code we get this error which says, “The name does not exists in the current context”. This is because the code behind file is not able to find the control being added to your aspx file.
Try to use the namespace using System.Text;
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" %>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With