Application identity not set Exception

前端 未结 3 1020
耶瑟儿~
耶瑟儿~ 2021-02-06 22:44

I have just converted a project to VS2010 and I now starting to see Exceptions in my software in IntelliTrace.

One such Exception is \'Application identity is not set\',

3条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-06 23:10

    If the problem is occuring in debugging you can first check if the debugger is attached before accessing any application settings:

    If System.Diagnostics.Debugger.IsAttached then
           Me.Text = "Debug Mode"
    Else 
           Me.Text = "Version " & My.Application.Deployment.CurrentVersion.ToString
    End If
    

提交回复
热议问题