Пример #1
0
        /// <summary>
        /// Execute an assembly using arguments and settings.
        /// </summary>
        /// <param name="assemblyPath">The assembly path.</param>
        /// <param name="arguments">The arguments.</param>
        /// <param name="settings">The settings.</param>
        public void Execute(FilePath assemblyPath, ProcessArgumentBuilder arguments, DotNetCoreExecuteSettings settings)
        {
            if (assemblyPath == null)
            {
                throw new ArgumentNullException(nameof(assemblyPath));
            }
            if (settings == null)
            {
                throw new ArgumentNullException(nameof(settings));
            }

            RunCommand(settings, GetArguments(assemblyPath, arguments, settings));
        }
Пример #2
0
        private ProcessArgumentBuilder GetArguments(FilePath assemblyPath, ProcessArgumentBuilder arguments, DotNetCoreExecuteSettings settings)
        {
            var builder = CreateArgumentBuilder(settings);

            if (!string.IsNullOrWhiteSpace(settings.FrameworkVersion))
            {
                builder.Append("--fx-version");
                builder.Append(settings.FrameworkVersion);
            }

            assemblyPath = assemblyPath.IsRelative ? assemblyPath.MakeAbsolute(_environment) : assemblyPath;
            builder.Append(assemblyPath.FullPath);

            if (!arguments.IsNullOrEmpty())
            {
                arguments.CopyTo(builder);
            }

            return(builder);
        }