2

仅当我从 TaskScheduler 运行时才会出现异常:

static class Program
{
    [STAThread]
    static void Main(string[] args)
     {
        Application.Run(new Master());
     }
}

public partial class Master : Form
{

   public Master()  //  EXCEPTION OCCURS HERE
   {

   }
}

任务调度器:

Run whether user logged in or not : Checked 
Run with highest privileges : Checked

System.ComponentModel.Win32Exception 未处理 HResult=-2147467259 Message=找不到指定的过程 Source=System.Windows.Forms ErrorCode=-2147467259 NativeErrorCode=127 StackTrace:在 System.Windows.Forms.NativeWindow.WindowClass.RegisterClass()在 System.Windows.Forms.NativeWindow.WindowClass.Create(String className, Int32 classStyle) 在 System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp) 在 System.Windows.Forms.Control.CreateHandle() 在 System.Windows。 Forms.Application.MarshalingControl..ctor() 在 System.Windows.Forms.Application.ThreadContext.get_MarshalingControl() 在 System.Windows.Forms.WindowsFormsSynchronizationContext..ctor() 在 System.Windows.Forms.WindowsFormsSynchronizationContext.InstallIfNeeded() 在System.Windows.Forms。Control..ctor(Boolean autoInstallSyncContext) 在 System.Windows.Forms.ScrollableControl..ctor() 在 System.Windows.Forms.ContainerControl..ctor() 在 System.Windows.Forms.Form..ctor() 在 FssClient。 FssClient.Program.Main(String[] args) InnerException 处的 Master..ctor():

4

0 回答 0