Solved

System.Web.Extentions Assembly Not Found

Posted on 2014-12-11
3
253 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Problem with Filesystemobject or .NET version 3 32
ADO.NET ENTITY DATA MODEL 3 30
What .NET URL re-routing tool did I use? 2 36
C# HTTP GET method sample code 3 40
This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

919 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now