gpt4 book ai didi

asp.net - Owin.IAppBuilder 不包含 asp.net 中 'MapSignalR' 错误的定义

转载 作者:行者123 更新时间:2023-12-01 07:56:00 24 4
gpt4 key购买 nike

我收到此错误

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?)



这是我的代码
 using System;
using System.Threading.Tasks;
using Microsoft.Owin;
using Owin;

[assembly: OwinStartup(typeof(VirtualClassroom.Startup1))]

namespace VirtualClassroom
{
public class Startup1
{
public void Configuration(IAppBuilder app)
{
app.MapSignalR();

}
}

}
我搜索了很多并按照堆栈溢出答案进行了尝试
'Owin.IAppBuilder' does not contain a definition for 'MapSignalR'我有

1.新增Microsoft.Owin//2.0.1版

2.新增Microsoft.Owin.Security//2.0.1版

3.新增微软Asp.Net SignalR

但我仍然遇到同样的错误。请帮忙。提前致谢!!

最佳答案

看来您的 Microsoft.AspNet.SignalR.Core.dll 版本较旧, 去 nuGet 并安装这个包,你应该看到这个扩展方法......
enter image description here

然后你应该会看到一堆这样的方法 public static IAppBuilder MapSignalR(this IAppBuilder builder);OwinExtensions .

编辑 : 基于评论

转到引用,然后单击此引用的属性...

enter image description here

版本应该类似于下面...

enter image description here

关于asp.net - Owin.IAppBuilder 不包含 asp.net 中 'MapSignalR' 错误的定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26801385/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com