private static void addJSFiles(ExcessCompilation compilation, Scope scope) { var serverConfig = compilation.Scope.GetServerConfiguration(); if (serverConfig == null) { throw new ArgumentException("IServerConfiguration"); } var clientCode = serverConfig.GetClientInterface(); if (string.IsNullOrWhiteSpace(clientCode)) { return; } var servicePath = serverConfig.GetServicePath(); if (servicePath == null) { throw new InvalidOperationException("cannot find the path"); } compilation.AddContent(servicePath, Templates .jsServiceFile(new { Members = clientCode })); }