private MemoryStream CompileSource() { string assemblyname = Path.GetFileNameWithoutExtension(this.OutputAssemblyName); var contents = new List <SourceText>(capacity: 2); contents.Add(SourceText.From(GeneratedCode)); if (!string.IsNullOrEmpty(UserCode)) { contents.Add(SourceText.From(UserCode)); } if (this._isCSharp) { return(CompilerHelper.CompileCSharpSilverlightAssembly(assemblyname, contents, referenceAssemblies: ReferenceAssemblies)); } else { return(CompilerHelper.CompileVBSilverlightAssembly(assemblyname, contents, ReferenceAssemblies, rootNamespace: "TestRootNS", documentationFile: null)); } }