在我的项目中添加 Owin Startup Class 会出现 SQL Server not found 错误
Adding an Owin Startup Class in my project gives a SQL Server not found error
我在我的 Startup.cs 文件中为 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);
}
}
}
我在 Web.config 文件中添加了一个密钥作为 -
<add key="owin:appStartup" value="Biosimilia.Startup" />
当我 运行 启动文件就位的应用程序时,出现错误 -
无法连接到 SQL 服务器数据库。
如果我从项目中删除密钥和启动文件,我会收到以下错误 -
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.`
我已经在这里看了很多关于这个主题的帖子,但都没有运气。请帮忙。
我的 web.config >
中有以下行
这导致 SQL 服务器连接超时错误。从 web.config 中删除了这一行。 OWIN startup.cs class 现在可以正常运行并且问题已解决。
似乎在使用 Identity 时,我们不需要在 web.config 中显式启用 roleManager。
我在我的 Startup.cs 文件中为 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);
}
}
}
我在 Web.config 文件中添加了一个密钥作为 -
<add key="owin:appStartup" value="Biosimilia.Startup" />
当我 运行 启动文件就位的应用程序时,出现错误 -
无法连接到 SQL 服务器数据库。
如果我从项目中删除密钥和启动文件,我会收到以下错误 -
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.`
我已经在这里看了很多关于这个主题的帖子,但都没有运气。请帮忙。
我的 web.config >
中有以下行这导致 SQL 服务器连接超时错误。从 web.config 中删除了这一行。 OWIN startup.cs class 现在可以正常运行并且问题已解决。
似乎在使用 Identity 时,我们不需要在 web.config 中显式启用 roleManager。