2

I created a basic chat application using SignalR 1.0.0 alpha 2. Now when I did simple modifications and tried to run the code, I get the following error:

Internal server Error 500

Even after undoing the modified code to the old code when the error didn't go I uninstalled Signalr thinking that it might got corrupted.

When I installed SignalR again (SignalR 1.0.0 rc1), I am getting following error in RegisterHubs.cs :

Error 1 The call is ambiguous between the following methods or properties: 'Microsoft.AspNet.SignalR.RouteExtensions.MapHubs(System.Web.Routing.RouteCollection)' and 'Microsoft.AspNet.SignalR.RouteExtensions.MapHubs(System.Web.Routing.RouteCollection)' C:\Users\noName\Desktop\Main project\Chat_Application\App_Start\RegisterHubs.cs 15 13 Chat_Application

I referred this link which says that this error occurs whenever there are duplicate methods. I understand the problem but I dont know how to resolve this..

I added following scripts related to newer version of SignalR in my aspx page (removed the older version links)

<script src="Scripts/jquery-1.8.3.min.js" type="text/javascript"></script>
<script src="Scripts/jquery.signalR-1.0.0-rc1.min.js" type="text/javascript"></script>
<script type="text/javascript" src='<%: ResolveClientUrl("~/signalr/hubs") %>'></script>
//even tried
//<script src="/signalr/hubs" type="text/javascript"></script>
//My javascript and CSS files here

Please help.

Community
  • 1
  • 1
Mr_Green
  • 40,727
  • 45
  • 159
  • 271

3 Answers3

0

Do the following:

  1. close visual studio (or even better: restart the computer, just to be safe)
  2. open C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files
  3. delete the files from this directory (these are temporary files, don't worry)
  4. start visual studio and rebuild all

I hope it works out for you!

Nir
  • 3,963
  • 8
  • 37
  • 51
0

You might have got assemblies from both versions in your project/system. First, check assembly references within all your projects - all relevant references should be pointing to a consistent SignalR version. If possible, get rid of previous version - delete from GAC and/or delete NuGet package from solution.

VinayC
  • 47,395
  • 5
  • 59
  • 72
  • Not sure why this happened but my project has two folders of previous version of SignalR in `packages` folder. When I removed it, the error gone. I even run `uninstall` command from nuget package manager console before installing the newer version of SignalR. – Mr_Green Jan 03 '13 at 09:27
0

I came up against the same issue, so I'm posting my solution here in the hope that it helps someone else:

If you have the Fall Update installed and use Add New Item > SignalR Hub Class, it also includes the following two packages and associated references:

Microsoft.AspNet.SignalR.Hosting.AspNet.1.0.0-alpha1 Microsoft.AspNet.SignalR.Hosting.Common.1.0.0-alpha1

Having these references included will cause the same issue. Removing them solved it for me.

You should also remove the Fall Update and install the latest one from here.

Town
  • 14,706
  • 3
  • 48
  • 72
  • yes, I did the same. The problem was that even after uninstalling the older version through Nuget console manager, it still left two packages which you mentioned. Those packages were the cause for the error I mentioned. and I think the links you provided works only for visual studio 2012 but not for VS 2010. Anyway, your post is useful and explains the correct way of solving the problem. – Mr_Green Jan 10 '13 at 04:44