Beispiel #1
0
        private static async Task RestoreProject(ITestProject testProject)
        {
            DotNetCliOptions options = new DotNetCliOptions
            {
                LocationPaths = new[]
                {
                    Path.Combine(TestAssets.Instance.RootFolder, DotNetCliVersion.Current.GetFolderName())
                }
            };

            await new DotNetCliService(new LoggerFactory(), NullEventEmitter.Instance, Microsoft.Extensions.Options.Options.Create(options), new OmniSharpEnvironment(testProject.Directory)).RestoreAsync(testProject.Directory);
        }
        private static IDotNetCliService CreateDotNetCliService(
            DotNetCliVersion dotNetCliVersion,
            ILoggerFactory loggerFactory,
            IOmniSharpEnvironment environment,
            IEventEmitter eventEmitter)
        {
            var dotnetPath = Path.Combine(
                TestAssets.Instance.RootFolder,
                dotNetCliVersion.GetFolderName());

            var options = new DotNetCliOptions {
                LocationPaths = new[] { dotnetPath }
            };

            if (!Directory.Exists(dotnetPath))
            {
                throw new InvalidOperationException(
                          $"Local .NET CLI path does not exist. Did you run build.(ps1|sh) from the command line?");
            }

            return(new DotNetCliService(loggerFactory, NullEventEmitter.Instance, Options.Create(options), environment));
        }