# Assembly

> Creates an assembly with the default compiler options.

## Definition

* **Type:** Constructor
* **Namespace:** [UnityEditor.Compilation](/engine/7000.0/script-reference/unityeditor/compilation.md)
* **Assembly:** UnityEditor.CoreModule

## Assembly(string, string, string\[], string\[], Assembly\[], string\[], AssemblyFlags)

Creates an assembly with the default compiler options.

```csharp
public Assembly(string name, string outputPath, string[] sourceFiles, string[] defines, Assembly[] assemblyReferences, string[] compiledAssemblyReferences, AssemblyFlags flags)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The name of the assembly.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The full file path to write the compiled assembly to.**** (\[string\[]]\(https\://learn.microsoft.com/dotnet/api/system.string)): The paths of the script files to compile into the assembly.**** (\[string\[]]\(https\://learn.microsoft.com/dotnet/api/system.string)): The scripting symbols to define when compiling the assembly.**** (\[Assembly\[]]\(/engine/7000.0/script-reference/unityeditor/compilation/assembly)): The assemblies compiled by Unity that this assembly references.**** (\[string\[]]\(https\://learn.microsoft.com/dotnet/api/system.string)): The file paths of precompiled assemblies that this assembly references.**** (\[AssemblyFlags]\(/engine/7000.0/script-reference/unityeditor/compilation/assemblyflags)): Flags that describe the assembly, for example whether it's an Editor assembly. For more information, refer to [AssemblyFlags](/engine/7000.0/script-reference/unityeditor/compilation/assemblyflags.md).

### Remarks

The assembly uses the default [ScriptCompilerOptions](/engine/7000.0/script-reference/unityeditor/compilation/scriptcompileroptions.md) and has an empty root namespace. To set either, use one of the other constructors.

## Assembly(string, string, string\[], string\[], Assembly\[], string\[], AssemblyFlags, ScriptCompilerOptions)

Creates an assembly with the specified compiler options.

```csharp
public Assembly(string name, string outputPath, string[] sourceFiles, string[] defines, Assembly[] assemblyReferences, string[] compiledAssemblyReferences, AssemblyFlags flags, ScriptCompilerOptions compilerOptions)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The name of the assembly.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The full file path to write the compiled assembly to.**** (\[string\[]]\(https\://learn.microsoft.com/dotnet/api/system.string)): The paths of the script files to compile into the assembly.**** (\[string\[]]\(https\://learn.microsoft.com/dotnet/api/system.string)): The scripting symbols to define when compiling the assembly.**** (\[Assembly\[]]\(/engine/7000.0/script-reference/unityeditor/compilation/assembly)): The assemblies compiled by Unity that this assembly references.**** (\[string\[]]\(https\://learn.microsoft.com/dotnet/api/system.string)): The file paths of precompiled assemblies that this assembly references.**** (\[AssemblyFlags]\(/engine/7000.0/script-reference/unityeditor/compilation/assemblyflags)): Flags that describe the assembly, for example whether it's an Editor assembly. For more information, refer to [AssemblyFlags](/engine/7000.0/script-reference/unityeditor/compilation/assemblyflags.md).**** (\[ScriptCompilerOptions]\(/engine/7000.0/script-reference/unityeditor/compilation/scriptcompileroptions)): The options to pass to the compiler, such as whether to allow unsafe code, the code optimization mode, and the API compatibility level. For more information, refer to [ScriptCompilerOptions](/engine/7000.0/script-reference/unityeditor/compilation/scriptcompileroptions.md).

### Remarks

The assembly has an empty root namespace. To set a root namespace, use the constructor that takes `rootNamespace`.

## Assembly(string, string, string\[], string\[], Assembly\[], string\[], AssemblyFlags, ScriptCompilerOptions, string)

Creates an assembly with the specified compiler options and root namespace.

```csharp
public Assembly(string name, string outputPath, string[] sourceFiles, string[] defines, Assembly[] assemblyReferences, string[] compiledAssemblyReferences, AssemblyFlags flags, ScriptCompilerOptions compilerOptions, string rootNamespace)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The name of the assembly.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The full file path to write the compiled assembly to.**** (\[string\[]]\(https\://learn.microsoft.com/dotnet/api/system.string)): The paths of the script files to compile into the assembly.**** (\[string\[]]\(https\://learn.microsoft.com/dotnet/api/system.string)): The scripting symbols to define when compiling the assembly.**** (\[Assembly\[]]\(/engine/7000.0/script-reference/unityeditor/compilation/assembly)): The assemblies compiled by Unity that this assembly references.**** (\[string\[]]\(https\://learn.microsoft.com/dotnet/api/system.string)): The file paths of precompiled assemblies that this assembly references.**** (\[AssemblyFlags]\(/engine/7000.0/script-reference/unityeditor/compilation/assemblyflags)): Flags that describe the assembly, for example whether it's an Editor assembly. For more information, refer to [AssemblyFlags](/engine/7000.0/script-reference/unityeditor/compilation/assemblyflags.md).**** (\[ScriptCompilerOptions]\(/engine/7000.0/script-reference/unityeditor/compilation/scriptcompileroptions)): The options to pass to the compiler, such as whether to allow unsafe code, the code optimization mode, and the API compatibility level. For more information, refer to [ScriptCompilerOptions](/engine/7000.0/script-reference/unityeditor/compilation/scriptcompileroptions.md).**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The root namespace that the scripts in the assembly belong to.
