public static void UpdateDefaultOptions(ReplAssembliesReferencesOptionsModel userOptions) { var VsDir = Path.GetDirectoryName(Environment.GetCommandLineArgs()[0]); //TODO: find location of Visual Studio installation //location of package var path = System.IO.Path.GetDirectoryName(typeof(CSharpScript).Assembly.Location); var options = ScriptOptions.Default.WithBaseDirectory(path) .WithSearchPaths( Path.Combine(VsDir, "PublicAssemblies"), Path.Combine(VsDir, "PrivateAssemblies")) .WithReferences("System", "system.core", "mscorlib", "Microsoft.CSharp","Microsoft.VisualStudio.ComponentModelHost","System.ComponentModel.Composition"); if (userOptions != null) { options = options.AddSearchPaths(userOptions.SearchPaths); options = options.WithReferences(userOptions.References); options = options.WithNamespaces(userOptions.Namespaces); defaultOptions = options; } }
public static void UpdateDefaultOptions(ReplAssembliesReferencesOptionsModel userOptions) { var VsDir = Path.GetDirectoryName(Environment.GetCommandLineArgs()[0]); //TODO: find location of Visual Studio installation //location of package var path = System.IO.Path.GetDirectoryName(typeof(CSharpScript).Assembly.Location); var options = ScriptOptions.Default.WithBaseDirectory(path) .WithSearchPaths( Path.Combine(VsDir, "PublicAssemblies"), Path.Combine(VsDir, "PrivateAssemblies")) .WithReferences("System", "system.core", "mscorlib", "Microsoft.CSharp", "Microsoft.VisualStudio.ComponentModelHost", "System.ComponentModel.Composition"); if (userOptions != null) { options = options.AddSearchPaths(userOptions.SearchPaths); options = options.WithReferences(userOptions.References); options = options.WithNamespaces(userOptions.Namespaces); defaultOptions = options; } }