在我的项目中实现信号R的问题
本文关键字:问题 信号 实现 我的 项目 | 更新日期: 2023-09-27 18:25:16
我需要在我的asp.net项目中实现信号R,以便向员工发送通知。但我面临着owinstantup的问题。我得到了这样的错误:
The following errors occurred while attempting to load the app.
- No assembly found containing an OwinStartupAttribute.
- The given type or method 'Notify' was not found. Try specifying the Assembly.
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.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.EntryPointNotFoundException: The following errors occurred while attempting to load the app.
- No assembly found containing an OwinStartupAttribute.
- The given type or method 'Notify' was not found. Try specifying the Assembly.
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.
我的服装课是这样的:
using Microsoft.Owin;
using Owin;
[assembly: OwinStartup("Notify",typeof(CRMWeb.Startup))]
namespace CRMWeb
{
public class Startup
{
public void Configuration(IAppBuilder app)
{
// Any connection or hub wire up and configuration should go here
app.MapSignalR();
}
}
}
我已将此行添加到web.config 中的应用程序设置中
<add key="owin:appStartup" value="Notify" />
无需在OwinStartup程序集上"通知"。只需添加微软提供的启动类即可。
试试这个:
[assembly: OwinStartup(typeof(CRMWeb.Startup))]
namespace CRMWeb
{
public class Startup
{
public void Configuration(IAppBuilder app)
{
app.MapSignalR();
}
}
}