Exception on .AddStormpath()

Was just following one of the .net tutorials for aspnetcore 2.0, and I’m getting a weird exception.

On this line:
public void ConfigureServices(IServiceCollection services)
{
services.AddStormpath();
}

I get this exception:
System.MissingMethodException: ‘Method not found: ‘Microsoft.Extensions.DependencyInjection.IServiceCollection Microsoft.Extensions.DependencyInjection.AuthenticationServiceCollectionExtensions.AddAuthentication(Microsoft.Extensions.DependencyInjection.IServiceCollection)’.’

	Source	"Stormpath.AspNetCore"	string
	StackTrace	"   at Stormpath.AspNetCore.StormpathMiddlewareExtensions.AddStormpath(IServiceCollection services, StormpathOwinOptions options)\r\n   at doctor_magpie.Startup.ConfigureServices(IServiceCollection services) in C:\\Users\\ekramer\\Documents\\Visual Studio 2017\\Projects\\doctor_magpie\\doctor_magpie\\Startup.cs:line 28"	string

I’ve been googling around for it and I’m not finding much. Anyone know what’s going on? The project is brand new and doesn’t really do anything yet. It’s in aSPnetcore 2.0 and Has the following nuget packages installed

Microsoft.AspNetCore.All 2.0.0
Microsoft.AspNetCore.Authentication.Cookies 2.1.0
Microsoft.AspNetCore.Authentication.OpenIdConnect 2.1.0
Microsoft.Extensions.DependencyInjection 2.1.0
Microsoft.IdentityModel.Tokens 5.2.2
Microsoft.NETCore.App 2.0.0
Stormpath.AspNetCore 4.1.0

Hey @eiredrake!

Just curious, which tutorial are you following? The library you are trying to use is deprecated. (And doesn’t support aspnetcore 2.0, which is why you are getting that error message.)

Try following this guide instead: https://developer.okta.com/quickstart/#/okta-sign-in-page/dotnet/aspnetcore

If you run into other issues, I’m happy to help!

Unfortunately I closed the browser and did not record the link but it was one of the ones on the Okta sight. I will give your link a try and see what happens.

Looks like you were right. I’m able to get it started and log in and out of a user now. Thank you for the assist.

E

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.