Building strongly typed application configuration utility with Roslyn

Awesome: Building strongly typed application configuration utility with Roslyn use Roselyn scripting engine to delegate to an external script filling a strongly typed instance.

The complete code is already very short but all is really made in only 3 lines :

  1. fill a ScriptOptions instance,
  2. creating a CSharpScript and
  3. running it asynchroniously.

For a production use, script error detection must be added and a way to add new references from script itself (and perhaps nuget references).

EDIT: I’ve neglected to follow a link about ConfigR: same needs but some step head. ConfigR use scriptcs on top of Roselyn to provide more possibilities: load sub script, add reference, use predefined packs (nuget packages but more script friendly using MEF) and debugging.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s