Solved

System.Web.Extentions Assembly Not Found

Posted on 2014-12-11
3
255 Views
Last Modified: 2014-12-20
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!
0
Comment
Question by:David Bach
  • 2
3 Comments
 
LVL 11

Expert Comment

by:LordWabbit
ID: 40495621
You need one of these
sc.pngIn 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

0
 

Accepted Solution

by:
David Bach earned 0 total points
ID: 40501485
Hi LordWabbit;

I appreciate your time in trying to help me. I did find my problem - not specifically, however, it was in my web.config.

In my current version of the AJAX toolkit I see in my VS 2013 Pro toolbox tab 2 AJAX groupings, namely, AJAX Extensions and AJAX Toolkit. The Toolkit does not have the ScriptManager but rather ToolScriptManager. However, the AJAX Extensions does have ScriptManager but not ToolScriptManager.

I am using ToolScriptManager.

I did find my problem in general. I have another VB solution using the .NET Framework 4. I copied the ASPX page into this other solution. The solution build was successful and the publish was successful.

I then copied the other web project's web.config file to the solution where the page did not build correctly. When I did this my symptoms cleared. The working version of my web.config is:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
	<system.web>
		<compilation debug="true" targetFramework="4.0">
			<assemblies>
				<add assembly="System.Data.Services.Client, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
				<add assembly="System.Net, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
			</assemblies>
		</compilation>
	<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>
			<dependentAssembly>
				<assemblyIdentity name="Microsoft.Data.OData" publicKeyToken="31bf3856ad364e35" culture="neutral" />
				<bindingRedirect oldVersion="0.0.0.0-5.6.3.0" newVersion="5.6.3.0" />
			</dependentAssembly>
			<dependentAssembly>
				<assemblyIdentity name="AjaxMin" publicKeyToken="21ef50ce11b5d80f" culture="neutral" />
				<bindingRedirect oldVersion="0.0.0.0-5.12.5436.22729" newVersion="5.12.5436.22729" />
			</dependentAssembly>
		</assemblyBinding>
	</runtime>
</configuration>

Open in new window

0
 

Author Closing Comment

by:David Bach
ID: 40510588
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.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

These instructions are based on installing Owncloud on your new raspberry pi connected with a usb HDD. What do you need Part A? A Raspberry Pi, model B. A boot SD card for the Raspberry Pi. A usb HDD An Ethernet cable to connect to the lo…
New Relic recently released its Synthetics product that allows for the creation of performance monitors that periodically test a site's performance. If you wish to test an interactive workflow New Relic employs Selenium WebDriverJS to run those test…
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question