Solved

System.Web.Extentions Assembly Not Found

Posted on 2014-12-11
3
269 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Put Machine Learning to Work--Protect Your Clients

Machine learning means Smarter Cybersecurity™ Solutions.
As technology continues to advance, managing and analyzing massive data sets just can’t be accomplished by humans alone. It requires huge amounts of memory and storage, as well as high-speed processing of the cloud.

Question has a verified solution.

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

Suggested Solutions

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
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…

751 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