Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

System.Web.Extentions Assembly Not Found

Posted on 2014-12-11
3
Medium Priority
?
307 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

When ransomware hits your clients, what do you do?

MSPs: Endpoint security isn’t enough to prevent ransomware.
As the impact and severity of crypto ransomware attacks has grown, Webroot has fought back, not just by building a next-gen endpoint solution capable of preventing ransomware attacks but also by being a thought leader.

Question has a verified solution.

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

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
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 video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Suggested Courses

783 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