Saturday, March 24, 2012

Pulling my hair out over System.web.Extensions

I am new to this board so do all please be kind!

I have being programming with ASP for sometime, recently moving to ASP.net. I use Visual Web Developer 2005 (the one downloadable from MS)

I am getting the following error:

CS0234: The type or namespace name 'Extensions' does not exist in the namespace 'System.Web' (are
you missing an assembly reference?)

I have definetly installed the AJAX extensions correctly as when I create a VB page as per the demonstration of adding the time reference, clicking a button to update the label on the page, etc, it works.

However if I switch to an application using a webservice, calling SQL server and using AJAX, I get the error. More information as follows:

Line 1: using System;
Line 2: using System.Web;
Line 3: using System.Web.Extensions; <LINE GIVING ERROR>
Line 4: using System.Web.Services;
Line 5: using System.Web.Services.Protocols;

c:\windows\system32\inetsrv> "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc.exe" /t:library
/utf8output
/R:"C:\WINDOWS\assembly\GAC_32\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll"
/R:"C:\WINDOWS\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll"
/R:"C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll"
/R:"C:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll"
/R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Mobile\2.0.0.0__b03f5f7f11d50a3a\System.Web.Mobile.dll"
/R:"C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll"
/R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Extensions.Design\1.0.61025.0__31bf3856ad364e35\System.Web.Extensions.Design.dll"
/R:"C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll"
/R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll"
/R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Extensions\1.0.61025.0__31bf3856ad364e35\System.Web.Extensions.dll"
/R:"C:\WINDOWS\assembly\GAC_32\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll"
/R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Services\2.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll"
/out:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\ws\69af2fc2\64a4ae07\App_Code.dopzyacv.dll" /debug- /optimize+ /w:4 /nowarn:1659;1699
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\ws\69af2fc2\64a4ae07\App_Code.dopzyacv.0.cs"
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\ws\69af2fc2\64a4ae07\App_Code.dopzyacv.1.cs"
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\ws\69af2fc2\64a4ae07\App_Code.dopzyacv.2.cs"

Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.42
for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727
Copyright (C) Microsoft Corporation 2001-2005. All rights reserved.

~\App_Code\EmployeeService.cs(3,18): error CS0234: The type or namespace name
'Extensions' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
~\App_Code\Employees.cs(4,18): error CS0234: The type or namespace name 'Extensions'
does not exist in the namespace 'System.Web' (are you missing an assembly reference?)

Where is it all going wrong!!!

Any help greatly appreciated!

Sorry if it doesnt, but does this post help? I remember reading it the other week :)

http://forums.asp.net/thread/1547872.aspx


A guy was having a similar issue on a hosted server :)

Cheers,

bobdeveaux


Hi,

I looked at the post after extensive searching of the forum before I decided to post myself.

I cannot see how that solution would work as the compiler seems to be finding System.Web.Extensions in the GAC - it's more a case of when it compiles the code it doesn't seem to like what it is reading!

I created the project in Visual Developer like I originally said. The project doesn't create a 'bin' directory only and 'App_code' one - I have tried creating a bin directory alongside 'App_code' and referencing what I had pasted into that however no joy.

Is it siginificant that the compiler seems to like the web.config file yet the two code files where it find using system.web.extensions throws it?

No comments:

Post a Comment