> For the complete documentation index, see [llms.txt](https://docs.yarnspinner.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.yarnspinner.dev/3.1/api/csharp/yarn.compiler/yarn.compiler.project/yarn.compiler.project.loadfromfile.md).

# LoadFromFile(string,string?)

Method in [Project](/3.1/api/csharp/yarn.compiler/yarn.compiler.project.md)

## Summary

Loads and parses a [Project](/3.1/api/csharp/yarn.compiler/yarn.compiler.project.md) from a file on disk.

```csharp
public static Project LoadFromFile(string path, string? workspaceRoot = null)
```

## Parameters

| Name                   | Description                                                       |
| ---------------------- | ----------------------------------------------------------------- |
| `string` path          | The path to the file to load.                                     |
| `string` workspaceRoot | The path of the root of the workspace in which `file` is located. |

## Returns

The loaded [Project](/3.1/api/csharp/yarn.compiler/yarn.compiler.project.md) .
