Closed albanx closed 1 year ago
owin:appStartup
should disable the assembly scanning, but you need to specify the full type and assembly:
(guessing at your assembly name)
<add key="owin:appStartup" value="Microsoft.OSG.Services.Membership, Microsoft.OSG.Services.Membership.WebRole.Startup" />
As for why this wasn't fixed by the prior change, I think you're failing earlier than the previous issue because of a different type situation.
owin:appStartup
should disable the assembly scanning, but you need to specify the full type and assembly: (guessing at your assembly name)<add key="owin:appStartup" value="Microsoft.OSG.Services.Membership, Microsoft.OSG.Services.Membership.WebRole.Startup" />
It does not actually. The way we managed to disable the assembly scanning was adding the config like this
<add key="owin:appStartup" value="Microsoft.OSG.Services.Membership.WebRole.Startup, Microsoft.OSG.Services.Membership.WebRole" />
We came to this conclusion looking at the source code here https://github.com/aspnet/AspNetKatana/blob/dbe159e43e2eee44f315f26268943e8ab5a4f60d/src/Owin.Loader/DefaultLoader.cs#L88
where it clearly skips the assembly scanning only if there is a comma in the value. The above trick fixed our issue, but I believe it is still a bug in general.
Hi team I have adopted the OWIN library for migrating to ASP.NET (OWIN) web API and I was able to test everything locally and it works as expected, decode tokens and authenticate a user consuming JWT tokens. Important to note I was not using OWIN previously, but we are a .NET 4.7.2 Framework web app version
However, when I deploy to testing environment I get this exceptions, caused by OWIN:
Looking at the code seems that the issue comes from this line
https://github.com/aspnet/AspNetKatana/blob/dbe159e43e2eee44f315f26268943e8ab5a4f60d/src/Owin.Loader/DefaultLoader.cs#L194
So far I load the startup class using
This dll is a transient dependency of some random dependency in the codebase (nothing to do with OWIN itself).
I did find a github issue describing the same behaviour (OWIN instantiating all assembly attributes to try find the OwinStartup class attribute) that I am seeing. They even claim to have fixed the issue in the latest version, but I am on that version and still see the issue.
I did try and follow the OWIN docs for defining what class is the OWIN Startup class, which I hoped would prevent OWIN from doing the assembly search, but it did not work.