Connector/Net Programming
1933
The Connector/Net support for partial trust has improved over time to simplify the configuration and
deployment process for hosting providers.
20.2.5.19.1. Evolution of Partial Trust Support Across Connector/Net Versions
The partial trust support for Connector/Net has improved rapidly throughout the 6.5.x and 6.6.x
versions. The latest enhancements do require some configuration changes in existing deployments.
Here is a summary of the changes for each version.
6.6.4 and Above: Library Can Be Inside or Outside GAC
Now you can install the
MySql.Data.dll
library in the Global Assembly Cache (GAC) as explained
in
Section 20.2.5.19.2, “Configuring Partial Trust with Connector/Net Library Installed in GAC”
, or in a
bin
or
lib
folder inside the project or solution as explained in
Section 20.2.5.19.3, “Configuring Partial
Trust with Connector/Net Library Not Installed in GAC”
. If the library is not in the GAC, the only protocol
supported is TCP/IP.
6.5.1 and Above: Partial Trust Requires Library in the GAC
Connector/Net 6.5 fully enables our provider to run in a partial trust environment when the library is
installed in the Global Assembly Cache (GAC). The new
MySqlClientPermission
class, derived
from the .NET
DBDataPermission
class, helps to simplify the permission setup.
5.0.8 / 5.1.3 and Above: Partial Trust Requires Socket Permissions
Starting with these versions, Connector/Net can be used under partial trust hosting that has been
modified to allow the use of sockets for communication. By default, partial trust does not include
SocketPermission
. Connector/Net uses sockets to talk with the MySQL server, so the hosting
provider must create a new trust level that is an exact clone of partial trust but that has the following
permissions added:
•
System.Net.SocketPermission
•
System.Security.Permissions.ReflectionPermission
•
System.Net.DnsPermission
•
System.Security.Permissions.SecurityPermission
Prior to 5.0.8 / 5.1.3: Partial Trust Not Supported
Connector/Net versions prior to 5.0.8 and 5.1.3 were not compatible with partial trust hosting.
20.2.5.19.2. Configuring Partial Trust with Connector/Net Library Installed in GAC
If the library is installed in the GAC, you must include the connection option
includesecurityasserts=true
in your connection string. This is a new requirement as of
Connector/Net 6.6.4.
The following list shows steps and code fragments needed to run a Connector/Net application in
a partial trust environment. For illustration purposes, we use the Pipe Connections protocol in this
example.
1. Install Connector/Net: version 6.6.1 or higher, or 6.5.4 or higher.
2. After installing the library, make the following configuration changes:
In the
SecurityClasses
section, add a definition for the
MySqlClientPermission
class,
including the version to use.
<configuration>
<mscorlib>
<security>
Содержание 5.0
Страница 1: ...MySQL 5 0 Reference Manual ...
Страница 18: ...xviii ...
Страница 60: ...40 ...
Страница 396: ...376 ...
Страница 578: ...558 ...
Страница 636: ...616 ...
Страница 844: ...824 ...
Страница 1234: ...1214 ...
Страница 1426: ...MySQL Proxy Scripting 1406 The following diagram shows an overview of the classes exposed by MySQL Proxy ...
Страница 1427: ...MySQL Proxy Scripting 1407 ...
Страница 1734: ...1714 ...
Страница 1752: ...1732 ...
Страница 1783: ...Configuring Connector ODBC 1763 ...
Страница 1793: ...Connector ODBC Examples 1773 ...
Страница 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Страница 1842: ...Connector Net Installation 1822 5 Once the installation has been completed click Finish to exit the installer ...
Страница 1864: ...Connector Net Visual Studio Integration 1844 Figure 20 24 Debug Stepping Figure 20 25 Function Stepping 1 of 2 ...
Страница 2850: ...2830 ...
Страница 2854: ...2834 ...
Страница 2928: ...2908 ...
Страница 3000: ...2980 ...
Страница 3122: ...3102 ...
Страница 3126: ...3106 ...
Страница 3174: ...3154 ...
Страница 3232: ...3212 ...