Membership Provider and Role Provider work but not Profile?

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
dknapp
Posts: 10
Joined: Wed 20 Sep 2006 18:26

Membership Provider and Role Provider work but not Profile?

Post by dknapp » Wed 07 Feb 2007 18:44

I am running into an issue when using the membership provider. I am able to login and create users and roles, but when I try to access the profile settings I get an error:

Code: Select all

Security Exception 

Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file. 

Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Source Error: [No relevant source lines]
This is on the hosted environment. When I run from my local machine the profile section works fine. The required permissions on the host is medium. I am new to the hosting envirnment setting so I do not know how to set this option for my site.

I don not understand why 2 out of the 3 work but not the last. I have tried to find an example but have not been able to find the information I need. The web.config file for the most part is setup right out of the help doc that comes with the provider. Can someone please help me out here. I have been fighting this issue for a few days now.

PS> The only reason I am using the MySQL Direct Provider is because my host does not allow people to use the DBO account in mSQL. And the default membership provider requires access to the dbo account. :(

Thanks!

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Thu 08 Feb 2007 07:26

What version of MySQLDirect .NET do you use?
Please provide me (alexeyi at crlab dot com) with your web.config file and the web_mediumtrust.config of your hosting providers.

dknapp
Posts: 10
Joined: Wed 20 Sep 2006 18:26

Post by dknapp » Thu 08 Feb 2007 14:26

I am using version 3.55.20.0. And like I said before My web.config settings are right out of the manual. With the exception of the properites.

Code: Select all

    
      
        
        
        
      
      
        
        
        
        
        
          
          
          
          
          
        
        
          
          
          
          
        
      
    
The users and roles work fine. Just not the profile section. As far as the host's config file goes, ya good luck there. I can send them an email but I do not think they will even reply to it. They are pretty locked down as far as security goes. They did say they set everything to medium trust. I still have not figured out how to set that for my site. Is there something I can ask them? Some sort of setting or something you are looking for? Maybe they will answer and yes/no question.

dknapp
Posts: 10
Joined: Wed 20 Sep 2006 18:26

Post by dknapp » Thu 08 Feb 2007 15:20

I have contacted my host and they are sending a request for a sysadmin to contact you via the email provided above. I do not know for sure that it will go threw. I did ask about the config file:
Dennis Selmeyer: Hello! Welcome to HostDepartment Live Chat Service. How may I help you?
Daniel Knapp: I am getting a permission error when i try to use the profile section of my membership provider.
Daniel Knapp: I have posted a question of the data provider's site and the developer would like for me to send a copy of your web_mediumtrust.config file and my web config for him to look at. is that possable?
Dennis Selmeyer: I see..
Dennis Selmeyer: we have such request before
Dennis Selmeyer: but.. I'm afraid we cannot send our medium trust config due to security reasons
Daniel Knapp: ya thats what i figured.
So in a nut shell if they do not contact you what should I do from here? I have access to mySQL and mSql and none of the membership provders are working for me. Both yours and the default one. With the exception of yours works with the users and roles at least. Just not the profile portion. :(

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Fri 09 Feb 2007 07:13

Could you send me your web site (or another simlified project that will have the same error)?
Are MySQLDirect .NET assemblies registered in the host's GAC?

cesarvegamx
Posts: 37
Joined: Tue 30 Jan 2007 07:43

Post by cesarvegamx » Tue 06 Mar 2007 23:32

dknapp:

Sorry to jump here, but could you say what your hosting provider is so to avoid it completely in the future?

I mean this:
Dennis Selmeyer: but.. I'm afraid we cannot send our medium trust config due to security reasons
is totally moronic. Like if by showing the medium trust config you were it were most likely to get an attack or something. That's really stupid.
I'm with Jodohost (I'm not related with them) and they would happily share their medium trust config, and even help you to configure your application.

Cody21
Posts: 112
Joined: Thu 01 Mar 2007 00:58

Post by Cody21 » Tue 06 Mar 2007 23:53

Alexey wrote:Are MySQLDirect .NET assemblies registered in the host's GAC?
Really? According to your Documentation (yes, I READ it), it sounds like all that is required is to include CoreLab.MySql.dll in my /bin folder. Is that not sufficient? Reason I ask is that I have yet been able to deploy and am at wits ends as to what I have to do.

From your HELP doc: "To deploy applications written with MySQLDirect .NET you should register run-time assembly "CoreLab.MySql.dll" at Global Assembly Cache (GAC) for appropriate framework or place it in the folder of your application."

cesarvegamx
Posts: 37
Joined: Tue 30 Jan 2007 07:43

Post by cesarvegamx » Wed 07 Mar 2007 00:37

Cody21:

I've deployed asp.net applications without having to register the libraries in the GAC.
But I did had to build the runtime licenses ( the dll, not the licx file). And that's was all.

Cody21
Posts: 112
Joined: Thu 01 Mar 2007 00:58

Post by Cody21 » Wed 07 Mar 2007 00:45

cesarvegamx wrote:Cody21:

I've deployed asp.net applications without having to register the libraries in the GAC.
But I did had to build the runtime licenses ( the dll, not the licx file). And that's was all.
Whew !! That's great news... As that is what I've so far been able to do (compile the l..dll.icenses file)... My major road block right now is "embedding the resource" ... I have no clue what that is and how to do that. I don't have Visual Studio (yet) ... only Visual Web Developer. So the "context" item that Alexey continues to talk about is not available to me. (Is there a command that I can execute to DO THIS?)

Did YOU have to do the "embed" procedure??? if so, what product did you use to do that? Thanks sooo much for any help.

cesarvegamx
Posts: 37
Joined: Tue 30 Jan 2007 07:43

Post by cesarvegamx » Wed 07 Mar 2007 00:50

I don't know where you did about embedding the resource, but I guess that just referring about put the dll inside your application as a resource.
Anyway, you don't need that.

Right now I have in my bin:

App_Licenses.dll
CoreLab.Data.dll
CoreLab.MySql.dll
CoreLab.MySql.Web.dll

And that's all I needed to do. Are you using the "publish" option ? or are you just uploading your project to your web root folder as is?

Cody21
Posts: 112
Joined: Thu 01 Mar 2007 00:58

Post by Cody21 » Wed 07 Mar 2007 00:56

cesarvegamx wrote:I don't know where you did about embedding the resource, but I guess that just referring about put the dll inside your application as a resource.
Anyway, you don't need that.

Right now I have in my bin:

App_Licenses.dll
CoreLab.Data.dll
CoreLab.MySql.dll
CoreLab.MySql.Web.dll

And that's all I needed to do. Are you using the "publish" option ? or are you just uploading your project to your web root folder as is?
hmm... I only have the App_licenses.dll, Corelab.mysql.dll, and Corelab.mysql.web.dll, and licenses.licx files in my /bin directory. I'll try adding the DATA piece and see if it resolves anything (License not found issue)... I have not found anything in the documentation (again) of WHAT files are supposed to be WHERE.

and Yes, Publishing.... not FTPing. Thanks !!!

Cody21
Posts: 112
Joined: Thu 01 Mar 2007 00:58

Post by Cody21 » Wed 07 Mar 2007 01:10

Cody21 wrote:
cesarvegamx wrote:I don't know where you did about embedding the resource, but I guess that just referring about put the dll inside your application as a resource.
Anyway, you don't need that.

Right now I have in my bin:

App_Licenses.dll
CoreLab.Data.dll
CoreLab.MySql.dll
CoreLab.MySql.Web.dll

And that's all I needed to do. Are you using the "publish" option ? or are you just uploading your project to your web root folder as is?
hmm... I only have the App_licenses.dll, Corelab.mysql.dll, and Corelab.mysql.web.dll, and licenses.licx files in my /bin directory. I'll try adding the DATA piece and see if it resolves anything (License not found issue)... I have not found anything in the documentation (again) of WHAT files are supposed to be WHERE.

and Yes, Publishing.... not FTPing. Thanks !!!
Well, that didn't fix my licensing issue either... (adding the Corelab.data.dll to my /bin directory.)

why does this have to be so difficult? How long have YOU been struggling? I guess I'm a bit frustrated that support seems to be on 1 person's shoulders here. I'm just not used to that with other vendors of products I have installed. Had I known this, I would have likely gone with another product..

cesarvegamx
Posts: 37
Joined: Tue 30 Jan 2007 07:43

Post by cesarvegamx » Wed 07 Mar 2007 02:05

I was using MySQLConnect with a VPS account, i.e. full access to everything.
But before I bought this product I made some test and it worked.
Just in case, I made a test application and uploaded to a spare domain in my current shared hosting and it worked.

THOUGH, one thing to note is that I could not make it work using a SqlDataSource, if I did that I got :
"Unable to find the requested .Net Framework Data Provider. It may not be installed".
But it was not a licensing problem, at least. Don't know what's this about.

But when I changed to use MySqlConnection and MySqlCommand it worked just fine and could connect and get data from a mysql database.

cesarvegamx
Posts: 37
Joined: Tue 30 Jan 2007 07:43

Post by cesarvegamx » Wed 07 Mar 2007 02:20

We've been talking about a "licensing" issue. However, I re-read your original post and that problem is about the trust level in which your website is running in the shared hosting. That's not a licensing problem.

Do you still getting that "Security Exception" error ? or is it a "licensing" error now ?

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Wed 07 Mar 2007 11:38

This thread was initiated by dknapp who had problems with security.

Post Reply