I recently added Hangfire to my project and added
<add key="owin:AutomaticAppStartup" value="false" />
to web.config , and OWIN stops working
my startup.cs looks like this
[assembly: OwinStartup("Inspinia_test", typeof(Inspinia_MVC5_SeedProject.Startup))]
//[assembly: OwinStartup(typeof(Inspinia_MVC5_SeedProject.Startup))]
namespace Inspinia_MVC5_SeedProject
{
public class Startup
{
private IEnumerable<IDisposable> GetHangfireServers()
{
GlobalConfiguration.Configuration
.SetDataCompatibilityLevel(CompatibilityLevel.Version_180)
.UseSimpleAssemblyNameTypeSerializer()
.UseRecommendedSerializerSettings()
.UseSqlServerStorage("Server=.\\SQLEXPRESS; Database=HangfireTest; User ID=sa;Password=xxxxxxxxxx;TrustServerCertificate=true;");
yield return new BackgroundJobServer();
}
public void Configuration(IAppBuilder app)
{
ConfigureAuth(app);
// createRolesandUsers().Wait();
app.UseHangfireAspNet(GetHangfireServers);
app.UseHangfireDashboard();
// Let's also create a sample background job
BackgroundJob.Enqueue(() => Debug.WriteLine("Hello world from Hangfire!"));
RecurringJob.AddOrUpdate("myrecurringjob",() => SendMail(), Cron.Minutely);
createRolesandUsers();
}
and I have added
as suggested by the article here
still I have the No owin.Environment item was found in the context. issue , the problem doesnot exist before, as now I know it auto detect the the startup class before but I cannot make it work manually and any one kindly help me with this issue, thank you a lot.
I tried to add
<add key="owin:AppStartup" value="Inspinia_test"/>
to the web.config and its not working,
sorry forgot to mention
Owin provide startup class in web.config (no automatic startup discovery)
this seems to address the same issue, yet it remains unresolved, please help me , thank you a lot.