ASP.NET Membership service creating Applications

I'm using the ASP.NET membership service in my application, but for some reason it creates 2 ApplicationIDs in the Applications table.

I've set the ApplicationName attribute in the web.config, but it still occurs. I have have the correct application name I've defined, and also a default application called '/' that gets created.

Any idea why this happens, as users are created for both, bu the membership table only gets populated with users for the '/' applicationID.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Most likely it is from Role Provider or Profile Provider. Check this

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
wint100Author Commented:
Hmm, great info, but I dont have these elements in my web.config at all. I only have the MembershipProvider defined. Do you think this could be the problem?
/ may be created from your old setting before you had your new ApplicationName set.

If you create a new user do you see two users being created in aspnet_Users table or just one?

If just one you don't need to worry.

Or you can share your membership provider settings from web.config here.

Or for some reason it could be from conflicting settings from your machine.config.
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

wint100Author Commented:
I cleared out the table today and I still get 2 x Applications created and new users are created twice. Annoying thing is that the Membership tabe gets populated with Users from the '/' ApplicationID, but UsersInRole has users from '/MyApplicationName' ApplicationID. The service works well, but if I do alookup on the Users email based on Role, it returns nothing because the UserID for the Role doesn't exist in the Membership table.

        <clear />
        <add name="AspNetSqlMembershipProvider" 
             type="System.Web.Security.SqlMembershipProvider, System.Web, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 
      passwordStrengthRegularExpression="" />

Open in new window

where is your RolesProvider in web.config or machine.config? Check your machine.config as that's my doubt.

Also try changing the name of the provider and also add defaultProvider attribute to your membership provider

<membership defaultProvider="MyCustomMembershipProvider">
        <clear />
        <add name="MyCustomMembershipProvider" ......
wint100Author Commented:
It is in the web.config as this gets deployed with my application, I don't touch the machine.config and this happens on my dev machine and production.
wint100Author Commented:
Also, there i no mention of my RoldProvider in the web.config, the only mention of roles and permissions is as follows:

<roleManager enabled="true" />
    <authentication mode="Forms">
      <forms name=".MyApplicationName_ASPXAUTH" />
        <add name="FriendlyName" />
        <add name="PictureURL" />
        <add name="Permissions" />
        <add name="AllowedSites" />

Open in new window

If you don't have your RolesProvider defined in your web.config, it is taking up from machine.config. You can define it explicitly in your web.config like in the link I provided earlier.
wint100Author Commented:
That's great, I'll test it ASAP. Thanks
Oh I missed your other comment with roles it looks you need to define both Roles and Profile Providers explicitly and set the applicationName as your membershipprovider.
wint100Author Commented:
Seems to have worked perfectly, thanks, just need to update my installer and release a new build now.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.