Error
'Owin.IAppBuilder' does not contain a definition for 'MapSignalR' and no extension method 'MapSignalR' accepting a first argument of type 'Owin.IAppBuilder' could be found (are you missing a using directive or an assembly reference?)
Code
using Microsoft.Owin;
using Owin;
[assembly: OwinStartup(typeof(SignalRChat.Startup))]
namespace SignalRChat
{
public class Startup
{
public void Configuration(IAppBuilder app)
{
// Any connection or hub wire up and configuration should go here
app.MapSignalR();
}
}
}
Any help would be greatly appreciated...
Update
signalR version 2.0.3
Microsoft Owin version 2.0.2
Owin version 1.0.0
Visual Studio 2012
Only install this nuget:
Install-Package Microsoft.AspNet.WebApi.OwinSelfHost
I had this same problem. Turns out my .csproj file the first line:
Project ToolsVersion="12.0" didn't match my other files. Changed it to:
Project ToolsVersion="14.0"
and no more compile issue.
Using MVC5, enter your Startup.cs file.
Add
IAppBuilder appBuilder
toConfigure()
:Then, under
add
appBuilder.MapSignalR();
Asp.Net 5 empty mvc project out of the box creates something that looks like this
Took me a while to notice that Configure was supposed to be Configuration and IApplicationBuilder needs to be IAppBuilder. I also pulled off the assembly annotation above the namespace.
I wound up scrapping trying to use Asp.Net 5 couldn't get it to work. Went back to 4.6 and everything worked fine. Followed this walkthrough http://www.asp.net/signalr/overview/getting-started/tutorial-getting-started-with-signalr
Finally was able to solve it by adding signalR dependencies before adding signalR from NuGet Packages
Step's I followed:
//version 2.0.1
//version 2.0.1
The reason I discovered was a problem with
version 2.0.2
of Microsoft.Owin and Microsoft.Owin.Security and then adding a class namedStartup.cs
with following code:Directly adding
Microsoft Asp.Net SignalR
from NuGet addsversion 2.0.2 of Microsoft.Owin and Microsoft.Owin.Security
which creates the problem.Hope it helps someone...!!
worked for me