I recently upgraded a newer project to version 3.5. I made sure the web.config had all of the proper changes. The error I am getting is.
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: }
would be the simple answer, but the error is pointing into the framework install itself.
Looking at the code here, I see the same thing, but no references to System.Text (Encoding.UTF8 is referenced in a number of places)... but it is pulled into pages in the global default web.config (C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\web.config)
in (xpath) /configuration/system.web/pages/namespace.
I am having a hard time with the upgrade. I appreciate the responses, but I think I am going to start a new 2008 project and start copying and pasting. Thanks, Mike
Marked as answer by TTETranscripts on Feb 08, 2008 03:37 PM
The problem can be resolved by removing the <clear/> under <namespaces>.
I'm not sure what references are required to allow for the DefaultWsdlHelpGenerator.aspx to compile but what is certain is that the <clear/> wipes out everything that
DefaultWsdlHelpGenerator assumed to exist.
TTETranscrip...
Member
132 Points
58 Posts
Error when compiling web service that was Upgraded from 2.0 to 3.5
Feb 08, 2008 02:12 PM|LINK
I recently upgraded a newer project to version 3.5. I made sure the web.config had all of the proper changes. The error I am getting is.
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:
Here is my web.config; Any help would be greatly appreciated. Thanks, MikeSource File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\DefaultWsdlHelpGenerator.aspx Line: 102
<?xml version="1.0"?>
<configuration>
<configSections>
<
sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"><
section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/> <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"><
section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/> <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/><
section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/> <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/></sectionGroup></sectionGroup></sectionGroup></configSections><appSettings/><
connectionStrings> </connectionStrings><system.web><
authentication mode="Windows"/> <trace enabled="true"/><
compilation debug="true" strict="false" explicit="true"> <assemblies><
add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/><
add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/><
add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies></compilation> <pages><
namespaces> <clear/><
add namespace="System"/> <add namespace="System.Linq"/><
add namespace="System.Web"/> </namespaces><
controls> <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/><
add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></controls></pages> <httpHandlers><
remove verb="*" path="*.asmx"/> <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/><
add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add verb="GET,HEAD" path="ScriptResource.axd" validate="false" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></httpHandlers><
httpModules> <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></httpModules></system.web><
system.codedom> <compilers><
compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4"> <providerOption name="CompilerVersion" value="v3.5"/><
providerOption name="OptionInfer" value="true"/> <providerOption name="WarnAsError" value="false"/></
compiler> </compilers></
system.codedom> <system.webServer><
validation validateIntegratedModeConfiguration="false"/> <modules><
remove name="ScriptModule"/> <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></modules><
handlers> <remove name="WebServiceHandlerFactory-Integrated"/><
remove name="ScriptHandlerFactory"/> <remove name="ScriptHandlerFactoryAppServices"/><
remove name="ScriptResource"/> <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/><
add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add name="ScriptResource" verb="GET,HEAD" path="ScriptResource.axd" preCondition="integratedMode" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></handlers></system.webServer><
runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><
dependentAssembly> <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/><
bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/></dependentAssembly> <dependentAssembly><
assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/><
bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/></dependentAssembly></assemblyBinding></runtime></configuration>rjcox
Contributor
7064 Points
1444 Posts
Re: Error when compiling web service that was Upgraded from 2.0 to 3.5
Feb 08, 2008 02:33 PM|LINK
EDIT: Deleted content, utter rubbish (Friday afternoon effect).
rjcox
Contributor
7064 Points
1444 Posts
Re: Error when compiling web service that was Upgraded from 2.0 to 3.5
Feb 08, 2008 03:10 PM|LINK
Try adding
would be the simple answer, but the error is pointing into the framework install itself.
Looking at the code here, I see the same thing, but no references to System.Text (Encoding.UTF8 is referenced in a number of places)... but it is pulled into pages in the global default web.config (C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\web.config) in (xpath) /configuration/system.web/pages/namespace.
I think you need to check that file.
TTETranscrip...
Member
132 Points
58 Posts
Re: Error when compiling web service that was Upgraded from 2.0 to 3.5
Feb 08, 2008 03:36 PM|LINK
I am having a hard time with the upgrade. I appreciate the responses, but I think I am going to start a new 2008 project and start copying and pasting. Thanks, Mike
PhilBlackbur...
Member
2 Points
1 Post
Re: Error when compiling web service that was Upgraded from 2.0 to 3.5
May 22, 2008 10:36 PM|LINK
The problem can be resolved by removing the <clear/> under <namespaces>.
I'm not sure what references are required to allow for the DefaultWsdlHelpGenerator.aspx to compile but what is certain is that the <clear/> wipes out everything that DefaultWsdlHelpGenerator assumed to exist.