dotConnect for Google BigQuery Documentation
On this page
    Configuring Trust Level for Web Applications
    On this page

    When an application using dotConnect for Google BigQuery runs in a partially trusted environment (which may apply to certain ASP.NET applications), it requires at least medium trust.

    Since dotConnect for Google BigQuery uses standard Microsoft .NET licensing, it also requires RegistryPermission. Although SecurityPermission is granted by default at the medium trust level, the set of flags for the SecurityPermission must be extended. You need to add the following flags: Assertion, SkipVerification, UnmanagedCode, and SerializationFormatter.

    You can configure the trust level for your application in the following ways:

    One option is to modify the .NET Framework configuration file for the medium trust level. Open the web_mediumtrust.config file located in the Windows\Microsoft.NET\Framework\<version>\Config\ folder, where <version> is the version of the target .NET Framework.

    Add the following line to the SecurityClasses tag:

    <SecurityClass Name="RegistryPermission" Description="System.Security.Permissions.RegistryPermission, mscorlib, Version=4.0.0.0, Culture=neutral,PublicKeyToken=b77a5c561934e089"/>
    
    

    Add the corresponding IPermissions element to the PermissionSet tag with the Name attribute equal to "ASP.Net":

    <PermissionSet class="NamedPermissionSet" version="1" Name="ASP.Net">
    	<IPermission
    			class="RegistryPermission" 
    			version="1" 
    			Unrestricted="true" 
    	/>
    	
    

    However, since the access to this file may be restricted on the target computer, you may define your custom trust level. For this, add the following lines to the system.web tag at the beginning of your application web.config file:

    <configuration>
    	<system.web>
    		<securityPolicy>
          			<trustLevel name="Custom" policyFile="web_customtrust.config" />
    		</securityPolicy>
    		<trust level="Custom" originUrl="" /> 
    
    This trustLevel tag here introduces the new "Custom" trust level, defined in the web_customtrust.config (that is located in the same directory as the web.config file). The trust tag sets the current trust level to "Custom".

    Create the web_customtrust.config file (copy the contents of web_mediumtrust.config into the new file and make the changes described above). You will need to deploy this file with your application.