में दावा पहचान बनाएं 0 विजुअल स्टूडियो 2015 मचान UserManager<TUser>
का उपयोग करता है जिसका उपयोग ClaimsIdentity
बनाने के लिए नहीं किया जा सकता है। क्या किसी के पास यह करने के लिए एक कामकाजी उदाहरण है?पहचान 3
VS2015 मचान फेंकता त्रुटियों:
public async Task<ClaimsIdentity> GenerateUserIdentityAsync(UserManager<ApplicationUser> manager)
{
// Note the authenticationType must match the one
// defined in CookieAuthenticationOptions.AuthenticationType
var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie);
// Add custom user claims here
return userIdentity;
}
N.B .: मैं ApplicationUser
के गुण जो IdentyUser
के साथ संघर्ष नहीं है जोड़ लिया है।
मचान फेंकने और कहां से क्या त्रुटि है? आपके द्वारा पोस्ट की गई विधि से पता चलता है कि यह 'दावे की स्थिति' – Nkosi
उपयोगकर्ता प्रबंधक <एप्लिकेशन यूज़र> में CreateIdentityAsync या DefaultAuthenticationTypes – Ungaro
पुन: पेश करने के लिए परिभाषा नहीं है: VS2015 एमवीसी 6 टेम्पलेट के साथ एक नया एएसपी.NET वेब प्रोजेक्ट बनाएं। ApplicationUser.cs में मॉडल के तहत, System.Security.Claims और Micosoft.AspNet.Identity के संदर्भ जोड़ें और उपरोक्त कोड को एप्लिकेशन यूज़र क्लास में डालें। उपरोक्त टिप्पणी में वर्णित त्रुटियों को देखें। – Ungaro