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\',
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
If this is a ClickOnce application being debugged, another option is to check the System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed
setting.
I found that this problem exists only if you untick "Just My Code" under debug options.