Table of contents
Collapse the table of content
Expand the table of content

Core.AutoOpenAttribute Class (F#)

Den Delimarsky|Last Updated: 6/20/2018
2 Contributors

This attribute can be used to designate a module or a namespace that is opened automatically.

Namespace/Module Path: Microsoft.FSharp.Core

Assembly: FSharp.Core (in FSharp.Core.dll)


[<AttributeUsage(AttributeTargets.Class ||| AttributeTargets.Assembly, AllowMultiple = true)>]
type AutoOpenAttribute =
new AutoOpenAttribute : string -> AutoOpenAttribute
new AutoOpenAttribute : unit -> AutoOpenAttribute
member this.Path :  string


This attribute is used for two purposes.

When applied to an assembly, it must be given a string argument, and this argument must indicate a valid module or namespace in that assembly. Source code files compiled with a reference to this assembly are processed in an environment where the given path is automatically opened.

When applied to a module within an assembly, then the attribute must not be given any arguments. When the enclosing namespace is opened in user source code, the module is also implicitly opened.

You can also use the short form of the name, AutoOpen.


newCreates an attribute used to mark a namespace or module path to be automatically opened when an assembly is referenced

Instance Members

PathIndicates the namespace or module to be automatically opened when an assembly is referenced or an enclosing module opened.


Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2

Version Information

F# Core Library Versions

Supported in: 2.0, 4.0, Portable

See Also

Microsoft.FSharp.Core Namespace (F#)

© 2020 Microsoft