Error Script does not exist in namespace System.Web

Apr 29, 2008 at 12:05 AM
I added your FacebookDataAPI class and replaced the Facebook.cs and FacebookService.cs files but when i try to compile my app i get an error that says:
Error The type or namespace name 'Script' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)

It's strange when I go on the FacebookDataAPI.cs file and try to expand on the System.Web to see if it has the .Script available it doesn't. But on another solution of mine it does. I checked my web.config and its setup for AJAX but I still get that error message.

Here is a copy of my web.config file.

<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere"/>
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
</sectionGroup>
</sectionGroup>
</sectionGroup>
</configSections>
<system.web>
<pages>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</controls>
</pages>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="false">
<assemblies>
<add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="MySql.Data, Version=1.0.8.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D"/></assemblies>
</compilation>
<httpHandlers>
<remove verb="" path=".asmx"/>
<add verb="" path=".asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add verb="" path="_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
</httpHandlers>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</httpModules>
</system.web>
<system.web.extensions>
<scripting>
<webServices>
<!-- Uncomment this line to customize maxJsonLength and add a custom converter -->
<!--
<jsonSerialization maxJsonLength="500">
<converters>
<add name="ConvertMe" type="Acme.SubAcme.ConvertMeTypeConverter"/>
</converters>
</jsonSerialization>
-->
<!-- Uncomment this line to enable the authentication service. Include requireSSL="true" if appropriate. -->
<!--
<authenticationService enabled="true" requireSSL = "true|false"/>
-->
<!-- Uncomment these lines to enable the profile service. To allow profile properties to be retrieved
and modified in ASP.NET AJAX applications, you need to add each property name to the readAccessProperties and
writeAccessProperties attributes. -->
<!--
<profileService enabled="true"
readAccessProperties="propertyname1,propertyname2"
writeAccessProperties="propertyname1,propertyname2" />
-->
</webServices>
<!--
<scriptResourceHandler enableCompression="true" enableCaching="true" />
-->
</scripting>
</system.web.extensions>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules>
<add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</modules>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated"/>
<add name="ScriptHandlerFactory" verb="" path=".asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add name="ScriptHandlerFactoryAppServices" verb="" path="_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</handlers>
</system.webServer>
</configuration>
Coordinator
Apr 29, 2008 at 1:10 AM
Kam!

Thanks for trying out the API.

Pleas try adding a reference in your project to the System.Web.Extensions assembly, and try again. Let me know how you get on.

Cheers!

joel


KamD wrote:
I added your FacebookDataAPI class and replaced the Facebook.cs and FacebookService.cs files but when i try to compile my app i get an error that says:
Error The type or namespace name 'Script' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)

It's strange when I go on the FacebookDataAPI.cs file and try to expand on the System.Web to see if it has the .Script available it doesn't. But on another solution of mine it does. I checked my web.config and its setup for AJAX but I still get that error message.

Here is a copy of my web.config file.



Apr 29, 2008 at 5:34 PM
Joel,

That did it so i build now. New problem tho. In my Default.aspx.cs page i have XmlDocument doc = FacebookDataApi.setUserPreference(_fbService, 0, "www.abc.com"); which is getting an error:
Error 1 The name 'FacebookDataApi' does not exist in the current context D:\Domains\FaceBook\wwwroot\Default.aspx.cs 55 27 D:\...\wwwroot\

Do i need to add another ref? if so where?

Thanks,
Kam
Apr 30, 2008 at 5:57 PM
Hey Joel,

I'm still unable to get my solution to work i keep getting that error when i try to use your class. Would it be possible for you to upload a full solution that compiles and runs?

Thanks,
Kam
Coordinator
May 12, 2008 at 11:43 AM
Edited May 12, 2008 at 12:23 PM
KamD,

I'm recovering from the flu and other nasties at the mo'. When I've managed to take the cotton wool out from around my brain and I can take caffeine agani, I'd be really happy to guide you through this.

In a couple of days?

Cheers,

joel

[edit]
Actually, the fog is lifting a bit. To compile it all up, you need the latest (1.6) release of the Facebook Toolkit: http://www.codeplex.com/facebooktoolkit

Can you try getting the v1.6 source, and copying my edited versions of the 2 classes (facebookservice.cs and facebookapi.cs) over the top of the v1.6 source. Then add the facebooktoolkit project to your solution, and add a projcet reference from your project to the facebooktoolkit solution.

This should compile and run.

Let me know if not.

[/edit]


KamD wrote:
Hey Joel,

I'm still unable to get my solution to work i keep getting that error when i try to use your class. Would it be possible for you to upload a full solution that compiles and runs?

Thanks,
Kam