Link to home
Start Free TrialLog in
Avatar of David Bach
David BachFlag for United States of America

asked on

System.Web.Extentions Assembly Not Found

Greetings Experts;

I receive message:
Reference required to assembly 'System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' containing the base class 'System.Web.UI.ScriptManager'. Add one to your project.
I am attempting to use Microsoft's example code for the AJAX SlideShowExtender control. The code and HTML follows:

Web Page HTML:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Rotation.aspx.vb" Inherits="Rotation" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
	<title></title>
</head>
<body>
	<form id="form1" runat="server">
		<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></ajaxToolkit:ToolkitScriptManager>
		<div>
			<br />
			<div style="text-align: center">
				<asp:Image ID="Image1" runat="server"
					Height="300"
					Style="border: 1px solid black; width: auto"
					ImageUrl="Images/Slides/Blue hills.jpg"
					AlternateText="Blue Hills image" />
				<br />
				<asp:Label runat="Server" ID="imageLabel1" /><br />
				<br />
				<asp:Button runat="Server" ID="prevButton" Text="Prev" Font-Size="Larger" />
				<asp:Button runat="Server" ID="playButton" Text="Play" Font-Size="Larger" />
				<asp:Button runat="Server" ID="nextButton" Text="Next" Font-Size="Larger" />
				<ajaxToolkit:SlideShowExtender ID="slideshowextend1" runat="server"
					TargetControlID="Image1"
					SlideShowServicePath="SlideService.asmx"
					SlideShowServiceMethod="GetSlides"
					AutoPlay="true"
					ImageDescriptionLabelID="imageLabel1"
					NextButtonID="nextButton"
					PlayButtonText="Play"
					StopButtonText="Stop"
					PreviousButtonID="prevButton"
					PlayButtonID="playButton" />
			</div>
		</div>
	</form>
</body>
</html>

Open in new window

Web Service
<%@ WebService Language="VB" CodeBehind="~/App_Code/SlideService.vb" Class="SlideService" %>

Open in new window

Web Service Code Behind. If I uncomment the line as instructed I receive a syntax error. So, I left the line commented.
Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols

' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
'<System.Web.Script.Services.ScriptService()> _
<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class SlideService
	Inherits System.Web.Services.WebService

	<WebMethod()> _
	Public Function GetSlides() As AjaxControlToolkit.Slide()

		Dim MySlides(4) As AjaxControlToolkit.Slide

		MySlides(0) = New AjaxControlToolkit.Slide("/Images/Slides/Blue hills.jpg", "Blue Hills", "Go Blue")
		MySlides(1) = New AjaxControlToolkit.Slide("/Images/Slides/Sunset.jpg", "Sunset", "Setting sun")
		MySlides(2) = New AjaxControlToolkit.Slide("/Images/Slides/Winter.jpg", "Winter", "Wintery...")
		MySlides(3) = New AjaxControlToolkit.Slide("/Images/Slides/Water lilies.jpg", "Water lillies", "Lillies in the water")
		MySlides(4) = New AjaxControlToolkit.Slide("/Images/Slides/VerticalPicture.jpg", "Sedona", "Portrait style picture")

		Return MySlides

	End Function

End Class

Open in new window

web.config file:
<?xml version="1.0"?>
<configuration>
  <system.web>
    <compilation debug="true">
      <assemblies>
        <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Data.Services.Client, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      </assemblies>
    </compilation>
    <customErrors mode="Off"/>
    <pages>
      <controls>
        <add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit"/>
      </controls>
    </pages>
  </system.web>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <!--<assemblyIdentity name="Microsoft.WindowsAzure.Storage" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-2.1.0.4" newVersion="2.1.0.4" />-->
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

Open in new window

I have System.Web.Extensions included as a reference in my project. The ASPX page build is where this error occurs.

The web service builds without error.

Any help you would be able to provide would be most helpful.

I'm running Windows 8.1 with Visual Studio Pro 2013.

Much thanks!
Avatar of LordWabbit
LordWabbit

You need one of these
User generated imageIn your markup, it would look like this in the markup
    <asp:ScriptManager runat="server">
        <Scripts>
            <asp:ScriptReference Name="jquery" />
            <asp:ScriptReference Name="jquery.ui.combined" />
        </Scripts>
    </asp:ScriptManager>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of David Bach
David Bach
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of David Bach

ASKER

My symptoms cleared when I copied another web.config file to the project where symptoms were occurring.

LordWabbit made a reasonable suggestion, however, when I tried the suggestion it did not solve my symptoms.

I appreciate LordWabbit's time to comment.