plz在mvc聊天应用程序中解决此错误 [英] plz solve this error in mvc chat apps

查看:104
本文介绍了plz在mvc聊天应用程序中解决此错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

错误: -



     错误 发生  while  尝试    load     app 
- 程序集 < span class =code-leadattribute>找到 包含 OwinStartupAttribute
- '配置'方法 找到 Microsoft VisualStudio Web PageInspector Runtime Startup Microsoft VisualStudio Web PageInspector 运行时,版本= 1. 0 0 0 ,Culture = neutral,PublicKeyToken = b03f5f7f11d50a3a'。
禁用 OWIN < span class =code-leadattribute> startup
discovery add appSetting owin:AutomaticAppStartup false 您的 web config
指定 < span class =code-leadattribute> OWIN startup Assembly 方法添加 appSetting owin:AppStartup 完全 < span class =code-leadattribute> qualified startup class configuration 方法 名称 您的 web config







Global.asax.cs代码: -



< pre lang =cs> 使用系统;
使用 System.Collections.Generic;
使用 System.Linq;
使用 System.Web;
使用 System.Web.Http;
使用 System.Web.Mvc;
使用 System.Web.Optimization;
使用 System.Web.Routing;



命名空间 SignalRChatApps
{
// 注意:有关启用IIS6或IIS7经典模式的说明,
// 访问http://go.microsoft.com/?LinkId=9394801

public class MvcApplication:System.Web.HttpApplication
{
protected void Application_Start()
{
RouteTable.Routes.MapHubs();



AreaRegistration.RegisterAllAreas();

WebApiConfig.Register(GlobalConfiguration.Configuration);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
AuthConfig.RegisterAuth();
}
}
}

解决方案

你没看过读我将Signal R安装到应用程序中时出现了吗?它告诉你要设置OWIN Startup类需要做什么:



我建议你访问这里: AsP.Net Signal R Site [ ^ ]

大约在页面的一半,它告诉你关于在Startup类中设置SignalR配置方法。


Error:-

The following errors occurred while attempting to load the app.
- No assembly found containing an OwinStartupAttribute.
- No 'Configuration' method was found in class 'Microsoft.VisualStudio.Web.PageInspector.Runtime.Startup, Microsoft.VisualStudio.Web.PageInspector.Runtime, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
To disable OWIN startup discovery, add the appSetting owin:AutomaticAppStartup with a value of "false" in your web.config.
To specify the OWIN startup Assembly, Class, or Method, add the appSetting owin:AppStartup with the fully qualified startup class or configuration method name in your web.config.




Global.asax.cs code:-

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;



namespace SignalRChatApps
{
    // Note: For instructions on enabling IIS6 or IIS7 classic mode,
    // visit http://go.microsoft.com/?LinkId=9394801

    public class MvcApplication : System.Web.HttpApplication
    {
        protected void Application_Start()
        {
            RouteTable.Routes.MapHubs();



            AreaRegistration.RegisterAllAreas();

            WebApiConfig.Register(GlobalConfiguration.Configuration);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            AuthConfig.RegisterAuth();
        }
    }
}

解决方案

You didn't read the "read me" that appears when you install Signal R into an application did you? It tells you what you need to do to set up the OWIN Startup class:

I suggest you visit here:AsP.Net Signal R Site[^]
About halfway down the page it tells you about setting up the SignalR Configuration method in the Startup class.


这篇关于plz在mvc聊天应用程序中解决此错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆