내 역할 제공자 : C#을 역할에 여러 공급자의 캔트 통화 기능
<roleManager enabled="true" cacheRolesInCookie="true" cookieName=".ASPROLES" defaultProvider="AspNetSqlRoleProvider">
<providers>
<clear/>
<add connectionStringName="ConnectionString1" applicationName="/" name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider,System.Web, Version=2.0.0.0, Culture=neutral,PublicKeyToken=xxx"/>
<add connectionStringName="ConnectionString2" applicationName="/" name="AspNetSqlRoleProviderProduction" type="System.Web.Security.SqlRoleProvider,System.Web, Version=2.0.0.0, Culture=neutral,PublicKeyToken=xxx"/>
</providers>
</roleManager>
내가 AddUserToRole를 호출하려고
:Error 59 'System.Web.Security.RoleProvider' does not contain a definition for 'AddUserToRole' and no extension method 'AddUserToRole' accepting a first argument of type 'System.Web.Security.RoleProvider' could be found (are you missing a using directive or an assembly reference?)
는'AddUsersToRoles'라는 방법이 아닙니다 사용해야합니까? – wkl
no : https://msdn.microsoft.com/en-us/library/system.web.security.roles.addusertorole%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396 – atroul
혼합되어 있습니다. [RoleProvider] (https://msdn.microsoft.com/en-us/library/system.web.security.roleprovider (v = vs.110) .aspx) 및 [역할] (https://msdn.microsoft. com/ko-us/library/system.web.security.roles (v = vs.110) .aspx). 아래 내 대답을 참조하십시오. – wkl