Cache to DLL in a scripting host?

18 views
Skip to first unread message

Markus Burrer

unread,
Jun 15, 2017, 5:28:00 PM6/15/17
to scriptcs
In the wiki it is only described how to use the -cache flag with the scriptcs command. But is it also possible to cache scripts as DLL's on a scripting host? This would speed up the start up time of the host application

Regards
Markus

Glenn Block

unread,
Jun 15, 2017, 7:33:06 PM6/15/17
to Markus Burrer, scriptcs
Yes it is possible. scriptcs.exe just calls to our libs. We use the CSharpPersistentEngine to do this: https://github.com/scriptcs/scriptcs/blob/dev/src/ScriptCs.Engine.Roslyn/CSharpPersistentEngine.cs. It will based on the filename check if a dll is present, if not it will compile and persist. 

When you create your ScriptcsServicesBuilder, you can set call builder.ScriptEngine<CsharpPersistentEngine>() before calling build().

Thanks
Glenn

irwan azam

unread,
Jul 7, 2017, 7:47:20 AM7/7/17
to scriptcs, markus...@gmail.com
How to check if the scriptcs use new compile dll or load from cache dll?
Reply all
Reply to author
Forward
0 new messages