# C# Code Validation and Roslyn Diagnostics

**Use case:** 

Analyze C# code for errors and warnings. Get structured JSON output with detailed diagnostics from the Roslyn compiler.

## Input

```json
{
  "mode": "snippet",
  "code": "Console.WriteLine(\"Hello from dotnet-check\");",
  "targetFramework": "net8.0",
  "languageVersion": "latest",
  "outputKind": "console",
  "nullable": true,
  "treatWarningsAsErrors": false,
  "strict": false
}
```

## Output

```json
{
  "success": {
    "label": "Success",
    "format": "boolean"
  },
  "errorCount": {
    "label": "Error count",
    "format": "integer"
  },
  "warningCount": {
    "label": "Warning count",
    "format": "integer"
  },
  "checkTimeMs": {
    "label": "Check time ms",
    "format": "integer"
  },
  "mode": {
    "label": "Mode",
    "format": "string"
  }
}
```

## About this Actor

This example demonstrates how to use [CSharp Compiler API — Validate C# Code (Roslyn Diagnostics)](https://apify.com/ihndev/dotnet-check) with a specific input configuration. Visit the [Actor detail page](https://apify.com/ihndev/dotnet-check) to learn more, explore other use cases, and run it yourself.