# Sandbox.Resources.ResourceCompileContext.WriteBlockJson

```csharp
void WriteBlockJson(string blockName, object obj)
```

Serialize an object to json and write it to a named block in the compiled
resource. Read it back at runtime in `M:Sandbox.Resource.OnLoaded(Sandbox.ResourceLoadContext)`.

### Parameters

- `blockName` (`string`)
- `obj` (`object`)

Declared in [Sandbox.Resources.ResourceCompileContext](/api/Sandbox.Resources.ResourceCompileContext).
Assembly: `Sandbox.Engine`.
