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