C:/Program Files/Common Files/Microsoft Shared/web server extensions/12|40|60/CONFIG/wss_minimaltrust.config
增加以下配置:
SecurityClasses下增加:
<SecurityClass Name="SqlClientPermission" Description="System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
NamedPermissionSets下增加:
<PermissionSet class="System.Security.NamedPermissionSet" version="1" Name="CustomLocalIntranet" Description="Custom permission set given to applications on the local intranet">
<IPermission class="System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" AllowBlankPassword="False">
<add ConnectionString="Data Source=(local);Integrated Security=true;" KeyRestrictions="Initial Catalog=;Connection Timeout=; Encrypt=;Packet Size=;" KeyRestrictionBehavior="AllowOnly" />
</IPermission>
</PermissionSet>
或: <IPermission class="SqlClientPermission"
version="1"
Unrestricted="true"
/>