首页 > 解决方案 > Win10程序上的VB .Net无法运行

问题描述

 Public Sub New()

    Dim stackframe As New Diagnostics.StackFrame

    Dim LogConfig As Log.Configure = New Log.Configure(My.Application.Info.ProductName)

    Log.EventLog.Write("Aplication Open")

    If Process.GetProcessesByName(My.Application.Info.ProductName).Length > 1 Then

        Log.ErrorLog.Write(stackframe.GetMethod.Name.ToString, "Application its running, can't duplicate it")

        End

    End If

    ' This call is required by the designer.
    Log.EventLog.Write("InitializeComponent")
    InitializeComponent()

    ' Add any initialization after the InitializeComponent() call.
    Log.EventLog.Write("ReadINI")
    If Not ReadINI(Application.StartupPath & "\" & Application.ProductName & ".ini") Then

        MsgBox("Failed!! Read ini file, please contact administrator", MsgBoxStyle.OkOnly, "Error")

        Log.ErrorLog.Write(stackframe.GetMethod.Name.ToString, "Read ini file failed")

        End

    End If

2020-02-06 11:38:03 [PCCLIENT] 应用程序打开

2020-02-06 11:38:03 [PCCLIENT] InitializeComponent

我正在尝试在具有 Windows 10 版本 1803 直到 1909 的客户端 PC 上执行程序,但无法运行它。我检查过,日志卡在 InitializeComponent() 中,但我无法跟踪它。

标签: vb.netinitializationstartup

解决方案


推荐阅读