ClearScript Library
ClearScript Library
ClearScript Library Reference
Microsoft.ClearScript
ScriptEngine Class
ScriptEngine Properties
AccessContext Property
AllowReflection Property
ContinuationCallback Property
Current Property
CustomAttributeLoader Property
DefaultAccess Property
DisableDynamicBinding Property
DisableExtensionMethods Property
DisableFloatNarrowing Property
DisableListIndexTypeRestriction Property
DisableTypeRestriction Property
DocumentSettings Property
EnableAutoHostVariables Property
EnableNullResultWrapping Property
EnforceAnonymousTypeAccess Property
ExposeHostObjectStaticMembers Property
FileNameExtension Property
FormatCode Property
Global Property
HostData Property
Name Property
NullExportValue Property
NullImportValue Property
Script Property
UndefinedImportValue Property
UseReflectionBindFallback Property
VoidResultValue Property

# ScriptEngineEnforceAnonymousTypeAccess Property

Enables or disables access restrictions for anonymous types.
Namespace: Microsoft.ClearScript
Assembly: ClearScript.Core (in ClearScript.Core.dll) Version: 7.5.0
Syntax
C#
VB
C++
F#
Copy

    public bool EnforceAnonymousTypeAccess { get; set; }

    Public Property EnforceAnonymousTypeAccess As Boolean
    	Get
    	Set

    public:
    virtual property bool EnforceAnonymousTypeAccess {
    	bool get () sealed;
    	void set (bool value) sealed;
    }

    abstract EnforceAnonymousTypeAccess : bool with get, set
    override EnforceAnonymousTypeAccess : bool with get, set

#### Property Value

Boolean

#### Implements

IScriptEngineEnforceAnonymousTypeAccess
Remarks
Anonymous types are internal and therefore accessible only within the same assembly, but ClearScript 5.5.3 and earlier permitted access to the properties of an object even if its type was internal. Newer versions strictly enforce AccessContext, but because anonymous types are particularly useful for scripting, ClearScript by default continues to expose their properties to external contexts. To override this behavior and enable normal access restrictions for anonymous types, set this property to true.
See Also

#### Reference

ScriptEngine Class
Microsoft.ClearScript Namespace

Copyright © Microsoft Corporation. All rights reserved.

Send comments on this topic to Microsoft