# Project

Class in [Yarn.Compiler](/3.1/api/csharp/yarn.compiler.md)

Inherits from `System.Object`

## Summary

Yarn Projects represent instructions on where to find Yarn scripts and associated assets, and how they should be compiled.

```csharp
public class Project
```

## Classes

| Name                                                                                                              | Description                                                                                                  |
| ----------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| [LocalizationInfo](/3.1/api/csharp/yarn.compiler/yarn.compiler.project/yarn.compiler.project.localizationinfo.md) | Stores the locations of where localized assets and a localized string table for a Yarn Project may be found. |

## Constructors

| Name                                                                                                            | Description                                                                                                |
| --------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| [Project()](/3.1/api/csharp/yarn.compiler/yarn.compiler.project/yarn.compiler.project..ctor-1.md)               | Initializes a new instance of the [Project](/3.1/api/csharp/yarn.compiler/yarn.compiler.project.md) class. |
| [Project(string,string?)](/3.1/api/csharp/yarn.compiler/yarn.compiler.project/yarn.compiler.project..ctor-2.md) | Initializes a new instance of the [Project](/3.1/api/csharp/yarn.compiler/yarn.compiler.project.md) class. |

## Fields

| Name                                                                                                                                  | Description                                                                       |
| ------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| [CurrentProjectFileVersion](/3.1/api/csharp/yarn.compiler/yarn.compiler.project/yarn.compiler.project.currentprojectfileversion.md)   | The current version of `.yarnproject` file format.                                |
| [WorkspaceRootPlaceholder](/3.1/api/csharp/yarn.compiler/yarn.compiler.project/yarn.compiler.project.workspacerootplaceholder.md)     | A placeholder string that represents the location of the workspace root in paths. |
| [YarnSpinnerProjectVersion2](/3.1/api/csharp/yarn.compiler/yarn.compiler.project/yarn.compiler.project.yarnspinnerprojectversion2.md) | A version number representing Yarn Spinner 2.                                     |
| [YarnSpinnerProjectVersion3](/3.1/api/csharp/yarn.compiler/yarn.compiler.project/yarn.compiler.project.yarnspinnerprojectversion3.md) | A version number representing Yarn Spinner 3.                                     |

## Methods

| Name                                                                                                                           | Description                                                                                                                           |
| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------- |
| [GetJson()](/3.1/api/csharp/yarn.compiler/yarn.compiler.project/yarn.compiler.project.getjson.md)                              | Gets a string containing JSON-formatted text that represents this [Project](/3.1/api/csharp/yarn.compiler/yarn.compiler.project.md) . |
| [IsMatchingPath(string)](/3.1/api/csharp/yarn.compiler/yarn.compiler.project/yarn.compiler.project.ismatchingpath.md)          | Gets a value indicating whether `path` is a path that is included in this project.                                                    |
| [IsValidVersionNumber(int)](/3.1/api/csharp/yarn.compiler/yarn.compiler.project/yarn.compiler.project.isvalidversionnumber.md) | Gets a value indicating whether `number` is a valid Yarn Spinner version number.                                                      |
| [LoadFromFile(string,string?)](/3.1/api/csharp/yarn.compiler/yarn.compiler.project/yarn.compiler.project.loadfromfile.md)      | Loads and parses a [Project](/3.1/api/csharp/yarn.compiler/yarn.compiler.project.md) from a file on disk.                             |
| [SaveToFile(string)](/3.1/api/csharp/yarn.compiler/yarn.compiler.project/yarn.compiler.project.savetofile.md)                  | Saves a [Project](/3.1/api/csharp/yarn.compiler/yarn.compiler.project.md) as JSON-formatted text to a file on disk.                   |

## Properties

| Name                                                                                                                                      | Description                                                                                                                                                                                                                           |
| ----------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [AllowLanguagePreviewFeatures](/3.1/api/csharp/yarn.compiler/yarn.compiler.project/yarn.compiler.project.allowlanguagepreviewfeatures.md) | Gets or sets a value indicating whether compiler features that are not intended for production use are allowed.                                                                                                                       |
| [BaseLanguage](/3.1/api/csharp/yarn.compiler/yarn.compiler.project/yarn.compiler.project.baselanguage.md)                                 | Gets or sets the base language of the project, as an IETF BCP-47 language tag.                                                                                                                                                        |
| [CompilerOptions](/3.1/api/csharp/yarn.compiler/yarn.compiler.project/yarn.compiler.project.compileroptions.md)                           | Gets or sets a dictionary containing instructions that control how the Yarn Spinner compiler should compile a project.                                                                                                                |
| [Definitions](/3.1/api/csharp/yarn.compiler/yarn.compiler.project/yarn.compiler.project.definitions.md)                                   | Gets or sets the path to a JSON file containing command and function definitions that this project references.                                                                                                                        |
| [DefinitionsFiles](/3.1/api/csharp/yarn.compiler/yarn.compiler.project/yarn.compiler.project.definitionsfiles.md)                         | Gets the absolute paths to the project's Definitions files.                                                                                                                                                                           |
| [DefinitionsPath](/3.1/api/csharp/yarn.compiler/yarn.compiler.project/yarn.compiler.project.definitionspath.md)                           | Gets the path to the Definitions file, relative to this project's location.                                                                                                                                                           |
| [ExcludeFilePatterns](/3.1/api/csharp/yarn.compiler/yarn.compiler.project/yarn.compiler.project.excludefilepatterns.md)                   | Gets or sets the collection of file search patterns that should be excluded from this project.                                                                                                                                        |
| [ExtensionData](/3.1/api/csharp/yarn.compiler/yarn.compiler.project/yarn.compiler.project.extensiondata.md)                               | Contains any data parsed from the source file that was not matched to a property on this type.                                                                                                                                        |
| [FileVersion](/3.1/api/csharp/yarn.compiler/yarn.compiler.project/yarn.compiler.project.fileversion.md)                                   | Gets or sets the file version of the project.                                                                                                                                                                                         |
| [Localisation](/3.1/api/csharp/yarn.compiler/yarn.compiler.project/yarn.compiler.project.localisation.md)                                 | Gets or sets the collection of [LocalizationInfo](/3.1/api/csharp/yarn.compiler/yarn.compiler.project/yarn.compiler.project.localizationinfo.md) objects that store information about where localized data for this project is found. |
| [Path](/3.1/api/csharp/yarn.compiler/yarn.compiler.project/yarn.compiler.project.path.md)                                                 | Gets the path that the [Project](/3.1/api/csharp/yarn.compiler/yarn.compiler.project.md) was loaded from.                                                                                                                             |
| [SourceFilePatterns](/3.1/api/csharp/yarn.compiler/yarn.compiler.project/yarn.compiler.project.sourcefilepatterns.md)                     | Gets or sets the collection of file search patterns used to locate Yarn files that form this project.                                                                                                                                 |
| [SourceFiles](/3.1/api/csharp/yarn.compiler/yarn.compiler.project/yarn.compiler.project.sourcefiles.md)                                   | Gets the collection of Yarn files that should be used to compile the project.                                                                                                                                                         |
| [WorkspaceRootPath](/3.1/api/csharp/yarn.compiler/yarn.compiler.project/yarn.compiler.project.workspacerootpath.md)                       | The location of the root of the workspace in which this project is located.                                                                                                                                                           |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.yarnspinner.dev/3.1/api/csharp/yarn.compiler/yarn.compiler.project.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
