我只想用ChatJ 4.0设置asp.net。我阅读了它的文档所提供的所有步骤。但我无法安装到我的应用程序。
这里我的web应用程序是用4.0框架构建的。这个聊天软件也可能支持4.5版本的更大版本。有没有人知道我是如何用SQLServer2008的asp.net 4.0安装这个聊天应用程序的。我成功地将所有的基本文件(如chatjs和signalR )都设置到了我的web应用程序中,但是在这里,startup.cs文件给出了一些编译时错误。
以下是我的startup.cs文件代码:
using ChatJs.Admin;
using Microsoft.Owin;
using Owin;
[assembly: OwinStartup(typeof(Startup))]
namespace ChatJs.Admin
{
public partial class Startup
{
public void Configuration(IAppBuilder app)
{
this.ConfigureAuth(app);
app.MapSignalR();
}
}
}以下是我的编译时错误:
Error 1 'ChatJs.Admin.Startup' does not contain a definition for 'ConfigureAuth' and no extension method 'ConfigureAuth' accepting a first argument of type 'ChatJs.Admin.Startup' could be found (are you missing a using directive or an assembly reference?) F:\EasyWeb\App_Code\Startup.cs 11 18 F:\EasyWeb\
Error 2 '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?) F:\EasyWeb\App_Code\Startup.cs 12 17 F:\EasyWeb\请帮帮我..。
发布于 2014-06-11 03:12:08
关于ConfigureAuth方法的缩写:
你指的是这个电话:
https://github.com/ChatJS/ChatJs-Demo/blob/master/ChatJs.Admin/Startup.cs#L17
它明显缺失的原因是因为微软确定了将所有ASP.NET启动代码放在App_Start文件夹中的最佳位置,所以这里有一个用于启动的部分类。ConfigureAuth方法如下:
关于MapSignalR方法的缩写:
MapSignalR方法是在来自Microsoft.AspNet.SignalR.Core程序集的类OwinExtensions中定义的。这是特定于SignalR的,它将只在.NET 4.5上运行。
在ChatJS Framework4.0中运行.NET 2.0
ChatJS 2.0将在.NET 4.0上运行,但是只有在引用SignalR 1而不是2时,ChatJS才会使用SignalR 2作为最新版本。请注意,微软将SignalR的初始化方式从版本1改为2,这样教程中的SignalR部分就不适用了。
https://stackoverflow.com/questions/23538956
复制相似问题