2017-03-06 82 views
0

我已经添加了Owin下面的启动代码在我Startup.cs文件中的SQL服务器 -在我的项目添加一个Owin启动类给出错误未找到

using System; 
using System.IO; 
using System.Threading.Tasks; 
using Microsoft.Owin; 
using Owin; 

[assembly: OwinStartupAttribute(typeof(Biosimilia.Startup))] 

namespace Biosimilia 
{ 
    public partial class Startup 
    { 
     public void Configuration(IAppBuilder app) 
     { 
      ConfigureAuth(app); 
     } 
    } 
} 

我加入的网络的关键。配置文件 -

<add key="owin:appStartup" value="Biosimilia.Startup" /> 

当我运行与到位的启动文件的应用程序,我得到的错误 -

无法连接到SQL Server数据库。

如果我拔出钥匙,并从项目启动文件,我碰到下面的错误 -

The following errors occurred while attempting to load the app. 
- No assembly found containing an OwinStartupAttribute. 
- No assembly found containing a Startup or [AssemblyName].Startup class. 
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. 

如果我添加一键我的web.config,以禁止启动发现如下 -

<add key="owin:AutomaticAppStartup" value="false"/> 

我碰到下面的错误 -

`No owin.Environment item was found in the context.` 

我已经看过上个很多帖子这里的主题已经没有运气。请帮忙。

回答

0

我有以下线在我的web.config>

这是导致SQL Server连接超时错误。从web.config中删除此行。 OWIN startup.cs类现在可以正确运行并解决问题。

似乎在使用Identity时,我们不需要在web.config中明确启用roleManager。

相关问题