.net6 System.Diagnostics.Process.Start error

毅俊 付 61 Reputation points
2022-04-12T06:24:44.957+00:00

System.ComponentModel.Win32Exception:“An error occurred trying to start process 'https://gitee.com/yhuse/SunnyUI' with working directory 'E:\Projects.NET\SunnyUI.LinkLabel\bin\Debug\net6.0-windows'. 系统找不到指定的文件。”

System.ComponentModel.Win32Exception:“An error occurred trying to start process 'C:\' with working directory 'E:\Projects.NET\SunnyUI.LinkLabel\bin\Debug\net6.0-windows'. 拒绝访问。”

Why????????

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,962 questions
0 comments No comments
{count} votes

Accepted answer
  1. Viorel 117.6K Reputation points
    2022-04-12T06:54:44.73+00:00

    It seems that the Process class can be used in .NET 6 in this manner:

    Process.Start( new ProcessStartInfo { FileName = @"http://. . . .", UseShellExecute = true } );
    Process.Start( new ProcessStartInfo { FileName = @"C:\", UseShellExecute = true } );
    

    There are some differences with the Process class from .NET Framework.

    14 people found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.