2
votes

I am working on an website application, for this i am using ASP.net c# and javascript. I am a newbie to asp.net. Everything was working fine till now, suddenly i struck up with the above server compiler error.

"Compiler Error Message: CS0433: The type 'AjaxControlToolkit.ToolkitScriptManager' exists in both 'c:\Users\Radhika\AppData\Local\Temp\Temporary ASP.NET Files\vs\c59f3bda\449eecb5\assembly\dl3\1a213be9\0bd50721_22d7cf01\BanquetNew.DLL' and 'c:\Users\Radhika\AppData\Local\Temp\Temporary ASP.NET Files\vs\c59f3bda\449eecb5\assembly\dl3\dc575640\0037b478_7df8ce01\AjaxControlToolkit.DLL'"

I dont know what to do, I have tried googling many sites for solving this error, but still i am getting this error.

for 4 days I am sittig with this error.

I tried to change even batch="false" in the web config file, but still also no use.

Here i am using ajax tool kit for calendar popup and also two calendars i am using here.

In my code, am using

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

     <asp:ToolkitScriptManager ID="toolkit1" runat="server"></asp:ToolkitScriptManager>
      <asp:CalendarExtender ID="CalendarExtender1" TargetControlID="Bookeddate"  runat="server" />
     <asp:CalendarExtender ID="CalendarExtender2" TargetControlID="functiondate"  runat="server"></asp:CalendarExtender>
3
Try to clean then build.. (Right click on project and click clean)Fahad Hussain
i tried to clean up but still same resultuser2801797
CLose visual studio and remove temporay files from your computer.Type %temp% in start menu search box and press enter than delete all files.Mairaj Ahmad

3 Answers

1
votes

Clear your ASP.NET temporary files. I keep a few batch files around for this. Here is the one for .NET 4, 32-bit:

@echo off
echo Stopping IIS...
iisreset /stop
echo Deleting ASP.NET 4.0 (32-bit) temporary files...
for /d %%d in ("c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\*") do rd /q /s "%%d"
iisreset /start
pause

EDIT: looks like that was the one for .NET 2.0. Anyway you get the idea. Run as admin.

1
votes

Just to make sure it isn't the most obvious problem :
I assume your solution has a project BanquetNew which is probably your website project.
Could you open your solution and search for a class ToolkitScriptManager

If you did create a ToolkitScriptManager class (and even used the same namespace as the official ToolkitScriptManager due to code copy pasting) then this error makes sense and you would either have to

  • rename your custom ToolkitScriptManager class
  • change it's namespace
  • delete it and use the one from the ajaxToolKit dll
0
votes

Let me add something to this issue, because I had the same compiler error CS0433.

I could temporarily fix it be running Reg Edit's script, but it occurred again and again, in Visual Studio 2013, and even when I deployed the web site.

So I considered what Kristof wrote, and that brought me closer to the root case: In my case the reason was that 2 controls had the same class name

<%@ Control ClassName="MyControl"  ... %>

because it was copy/pasted (the CodeBehind="..." and Inherits="..." properties were different, but the ClassName was the same for both controls).

After fixing this (i.e. giving unique ClassNames for the 2 controls) as follows:

<%@ Control ClassName="MyControl1"  ... %>
<%@ Control ClassName="MyControl2"  ... %>

the error did not occur again.

Lesson learned: A temp fix is okay, but always search and look after the root cause!