When deserializing limitations the system must find used to limit types. For type search uses a set of system assemblies, as well as the current executable Assembly. If the limitation there is a class, for example, inherits from external-class, then when deserializing, an error may occur because the system can’t find the type specified in limit. To solve this problem you can specify in the. config file of the Assembly, which can have the types used in the limitation.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
	<!-- ... -->
    <section name="WebLimitSerializer" type="IIS.ExpressionSerialization.Configuration.WebLimitSerializer, IIS.ExpressionSerialization" />
	<!-- ... -->
  </configSections>
  <!-- ... -->
  <WebLimitSerializer>
    <searchedAssemblies>
      <add assembly="Pornoamaterke" />
    </searchedAssemblies>
  </WebLimitSerializer>
  <!-- ... -->
</configuration>

Example

Suppose there is a class MyClass located in the Assembly StageWithBaseClassProduct(Objects), which is external-class for a class SonClass located in the Assembly StageWithExternalClassProduct(Objects). When you set limitations in the application StageWithExternalClassProduct class SonClass without specifying additional settings, an error will occur because the system fails to find base class MyClass in known assemblies.

To ensure that there was no error, it is necessary in the web-config to specify the following: register section

<configSections>
    <section name="WebLimitSerializer" type="IIS.ExpressionSerialization.Configuration.WebLimitSerializer, IIS.ExpressionSerialization" />
</configSections>

and specify which assemblies can be external-classes

<WebLimitSerializer>
	<searchedAssemblies>
		<add assembly="StageWithBaseClassProduct(Objects), Version=1.0.0.1, Culture=neutral, PublicKeyToken=null" />
	</searchedAssemblies>
</WebLimitSerializer>