最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

visual studio - how to run uipath nupkg in c# - Stack Overflow

programmeradmin0浏览0评论

I'm having trouble running UiPath's .nupkg file using C# Visual Studio.

I used to run the command "\UiPath\Studio\UiRobot.exe" -file "xxx.nupkg" -input "{ 'txt_path': test.txt' }" in CMD, and it was successful.

However, when i try it on c# on debug mode (See the similar code below.)

using System;
using System.Diagnostics;

class Program
{
    static void Main()
    {
        // Define the command and arguments
        string command = "\"UiPath\\Studio\\UiRobot.exe\"";
        string fileArgument = "-file \"xxx.nupkg\"";
        string inputArgument = "-input \"{{ 'txt_path': '\\\\test.txt' }}\"";

        // Combine command and arguments
        string fullCommand = $"{command} {fileArgument} {inputArgument}";

        // Start the process
        ProcessStartInfo startInfo = new ProcessStartInfo
        {
            FileName = "cmd.exe",
            Arguments = $"/C {fullCommand}",
            RedirectStandardOutput = true,
            RedirectStandardError = true,
            UseShellExecute = false,
            CreateNoWindow = false
        };

        using (Process process = Process.Start(startInfo))
        {
            using (var reader = process.StandardOutput)
            {
                string result = reader.ReadToEnd();
                Console.WriteLine("Output:");
                Console.WriteLine(result);
            }

            process.WaitForExit();
            Console.WriteLine($"Process exited with code: {process.ExitCode}");
        }
    }
}

Nothing appears on my computer, and there’s no popup window, unlike when I run the command in CMD.

UIpath is already install on my local computer.

-----------------Update-----------------

I am using IIS Express to host a server that triggers the UiPath .nupkg file.

发布评论

评论列表(0)

  1. 暂无评论