Role Manager Exception

Discussion in 'General troubleshooting' started by Jnan, Mar 22, 2011.

  1. I'm new to .NET so I'm getting my feet wet using MS Webmatrix.

    Publishing the site (not FTP but published from WebMatrix) appeared to be successful. But when running it online I immediately get this error:

    System.Configuration.Provider.ProviderException: The Role Manager feature has not been enabled.

    Line 2: WebSecurity.InitializeDatabaseConnection("StarterSite", "UserProfile", "UserId", "Email", true);

    Any suggestions would be much appreciated!
     
  2. Ray

    Ray

    Yeah this is difficult because webmatrix doesn't really setup the roles for the form authentication.

    Try this. Download MS Visual Web Developer 2010. This is a free version of VS 2010. Now, open Visual Web Developer and try to navigate to your site that should be on your local computer. A copy should still exist on your computer. Once you have it opened you can go to Tools/Web Site Administration tool and setup the roles and provider for your site. Make sure you have the web.config file pointing to Winhost SQL 2008 server and the database we gave you. It doesn't matter if the website you are accessing is on your computer. What matters is that it is pointing to our SQL server. Once you created the roles and users, then you can pull up your site that is hosted on our web server and input the login and password you just created.
     
    Last edited by a moderator: Oct 14, 2015
  3. Fantastic -- exactly what I needed to know. Winhost rocks!

    Thank you Ray!
     
  4. Hello,
    I have followed the above instructions, however I am getting this error. Any help is greatly appreciated!

    I have double-checked my credentials. I am using WebMatrix to build my site, and no matter what I do, it just keeps throwing errors at me.
     
    Last edited by a moderator: Oct 14, 2015
  5. Ray

    Ray

    Last edited by a moderator: Oct 14, 2015
  6. Thank you @Ray. I already added the connectionString from that KB article a while ago however what I would <b>love</b> to know is why all these features (Roles/Authentication/etc etc etc) work when Running locally via webmatrix and also when I upload a customers site to applied-i.net? But not Winhost? Correct me if I'm wrong, but to me that suggests that Winhost's configuration is different, or lacks certain configuration?
     
    Last edited by a moderator: Oct 14, 2015
  7. Ray

    Ray

    Everything you experienced shows that you updated the connection string to point to the Winhost SQL server. Webmatrix is a little fun and weird in a way where you can use SQL compact edition but you need to upload all the required files/binaries/assemblies to our web server. Sometimes when the customer updates the connection string to point to a full SQL 2008 version rather than use the SQL CE version the fail to also migrate the objects and data in their SQL CE to our SQL 2008 server.
     
    Last edited by a moderator: Oct 14, 2015
  8. Issues with Configuration

    I am using the IIs 7 Remote manager, and I have already configure successfully configured the Database with the Sql Memberships schema.

    But when I try to create the users and the roles I get the following error.


    ---------------------------
    .NET Roles
    ---------------------------
    This feature cannot be used because the default provider type could not be determined to check whether it is a trusted provider.



    You can use this feature only when the default provider is a trusted provider. If you are a server administrator, you can make a provider a trusted provider by adding the provider type to the trusted providers list in the Administration.config file. The provider has to be strongly typed and added to the GAC (Global Assembly Cache).



    Please advice
     
  9. Ray

    Ray

    Last edited by a moderator: Oct 14, 2015
  10. Did anyone ever get this to work?

    I elevated this to the asp.net forums and their procedures are the same as the comments/KB in Winhost. Still does not work on Winhost.
     
    Last edited by a moderator: Oct 14, 2015
  11. Ray

    Ray

    What do you mean? I think you maybe talking about MS Razor to setup your web forms. With Razor the process is totally different. If you build your ASP.Net Membership/Roles provider with the traditional ASP.Net templates then the process should work. But if you decide to use Razor, well, lets just say its a little more complicated then that.
     
  12. Last edited by a moderator: Oct 14, 2015

Share This Page