# LoadFromFile(string,string?)

Method in [Project](https://docs.yarnspinner.dev/api/csharp/yarn.compiler/yarn.compiler.project)

## Summary

Loads and parses a [Project](https://docs.yarnspinner.dev/api/csharp/yarn.compiler/yarn.compiler.project) 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](https://docs.yarnspinner.dev/api/csharp/yarn.compiler/yarn.compiler.project) .
