Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 295 Vote(s) - 3.4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
'Owin.IAppBuilder' does not contain a definition for 'MapSignalR'

#1
### 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
Reply

#2
Finally was able to solve it by adding ***signalR*** dependencies before adding signalR from NuGet Packages
Step's I followed:

1. Added Microsoft.Owin `//version 2.0.1`
2. Added Microsoft.Owin.Security `//version 2.0.1`
3. Added Microsoft Asp.Net SignalR

The reason I discovered was a problem with `version 2.0.2` of *Microsoft.Owin and Microsoft.Owin.Security* and then adding a class named ***`Startup.cs`*** with following code:

using Microsoft.Owin;
using Owin;

[assembly: OwinStartup(typeof(webApp.Startup))]
namespace webApp
{
public static class Startup
{
public static void Configuration(IAppBuilder app)
{
app.MapSignalR();
}
}
}

Directly adding `Microsoft Asp.Net SignalR` from NuGet adds `version 2.0.2 of Microsoft.Owin and Microsoft.Owin.Security` which creates the problem.
Hope it helps someone...!!
Reply

#3
Update-Package Owin -Reinstall

worked for me
Reply

#4
Asp.Net 5 empty mvc project out of the box creates something that looks like this



using Microsoft.Owin;
using Owin;
namespace DeadlyChat
{
public class Startup
{
// For more information on how to configure your application, visit

[To see links please register here]

public void ConfigureServices(IServiceCollection services)
{
}

public void Configure(IApplicationBuilder app)
{
app.MapSignalR();



}
}
}
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

[To see links please register here]

Reply

#5
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.
Reply

#6
Using MVC5, enter your Startup.cs file.

Add `IAppBuilder appBuilder` to `Configure()`:

public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IAppBuilder appBuilder)
{

Then, under

app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
});

add `appBuilder.MapSignalR();`

Reply

#7
Install Nuget Package: `Microsoft.AspNet.Identity.Owin`
Reply

#8
Only install this nuget:

Install-Package Microsoft.AspNet.WebApi.OwinSelfHost
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through