0

I'm trying to generate a password reset token using the following:

Dim resetToken As String
Dim options As New IdentityFactoryOptions(Of UserManager)

manager.UserTokenProvider = New DataProtectorTokenProvider(Of ApplicationUser)(options.DataProtectionProvider.Create("PasswordReset"))

resetToken = manager.GeneratePasswordResetToken(user.Id)

I receive an error:

Object reference not set to an instance of an object.

on the highlighted piece of code. I simply cannot figure out why as the examples I've researched are identical.

Racil Hilan
  • 24,690
  • 13
  • 50
  • 55
  • 1
    I know I have old eyes but which line of code is "highlighted"? – Mary Mar 16 '18 at 02:20
  • You know, the "highlighted piece"... Also this has been answered many times. – Trevor Mar 16 '18 at 02:21
  • 2
    Possible duplicate of [What is a NullReferenceException, and how do I fix it?](https://stackoverflow.com/questions/4660142/what-is-a-nullreferenceexception-and-how-do-i-fix-it) – Trevor Mar 16 '18 at 02:23
  • Well, start a debugger and find out which of the objects are null and see why they are null. – trailmax Mar 16 '18 at 10:56

0 Answers0