Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

System.NotSupportedException: Specified method is not supported

Is it possible to get the password of a user? How, please? When I've tried this code :

WebSecurity.InitializeDatabaseConnection("nectarys-pc.MonitoringN.dbo", "Superviseur", "UserId", "matricule", autoCreateTables: true);
var membership = (SimpleMembershipProvider)Membership.Provider;
model.motDePasse = membership.GetUser(superviseur.matricule, false).GetPassword();

This exception appears in the last line :

System.NotSupportedException: Specified method is not supported.

How to deal this?

Note that superviseur.matricule is not the source of the problem.

like image 315
Lucie kulza Avatar asked Oct 21 '22 14:10

Lucie kulza


1 Answers

As per MSDN - If EnablePasswordRetrieval in web.config is false, a NotSupportedException exception is thrown.

Check this resource to find out how to set enablePasswordReset in Web.config

like image 140
ramiramilu Avatar answered Nov 28 '22 09:11

ramiramilu