Attempt to access the method failed.

Attempt to access the method failed.

Postby GUYS » Thu 23 Mar 2006 15:09

Hi,

I got the components in runtime working using Visual Web Developer 2005 Express Edition, but when trying to connect to my database using "MySqlConnection conn = new MySqlConnection(connectionString);" I get the error "Attempt to access the method failed". I know this has got to do with the trust level settings of my ISP. But that is exact one of the reasons why I would like the use the CoreLab components.

Can you help?

Guy
GUYS
 
Posts: 2
Joined: Wed 22 Mar 2006 15:43

Postby Alexey » Fri 24 Mar 2006 11:00

CoreLab.MySql assembly doesn't contain unsafe code, it contains AllowPartiallyTrustedCallers attribute, it is fully CLS compliant. These actions allow using MySQLDirect .NET on web servers.

We think the problem might be in your server configuration. Contact your ISP to configure the server to allow using of CoreLab.MySql assembly.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

AllowPartiallyTrustedCallers & trust level

Postby GUYS » Fri 24 Mar 2006 12:45

Thanks for the answer.

I'll ask them to do so. Can you tell me what actions they should do to allow the use of the CoreLab.MySql assembly ?

Thanks,

Guy
GUYS
 
Posts: 2
Joined: Wed 22 Mar 2006 15:43

Postby Alexey » Thu 30 Mar 2006 13:15

The problem can be resolved as follows:
You have to add
Code: Select all
into section and
Code: Select all
                                                                class="SocketPermission"
                                    version="1"
                                    Unrestricted="true"
                            />

subsection into
Code: Select all
                                         class="NamedPermissionSet"
                                version="1"
                                Name="ASP.Net">

section in file
Or you can set "trust level" attribute to "Full" in \web.config file.
Besides, you should download new version (3.50) from our site and use it, because this problem was not fixed in 3.20 version.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43


Return to dotConnect for MySQL