public ScriptScope createScope() { ScriptScope scope = rc.createScope(scriptKey); try { script.Execute(scope); } catch (Exception e) { string error = e.Message; error = error.Substring(0, error.IndexOf("File \"") + 6) + error.Substring(error.IndexOf(ResourceComponent.DEFAULTROOTDIRECTORY) + ResourceComponent.DEFAULTROOTDIRECTORY.Length + 1); Trace.WriteLine(error); scope = null; } return(scope); }