ClickOnce: Application identity is not set.
Firstly, how do you debug such a program, as when I run the program, it falls over when I try to get theCurrentDeployment object with an error: The application is not installed. Secondly, I created a setup project and installed my program, but I am now getting the error: Application identity is not set. I'm sure this is just a property that needs setting somewhere, but I cannot find it. Here is my code: Private
objAppDeploy = System.Deployment.Application.ApplicationDeployment.CurrentDeployment
If objAppDeploy.CheckForUpdateThen
EndIfEndSubAnd here is the full error when trying to run the installed apllication: ************** Exception Text **************
System.Deployment.Application.InvalidDeploymentException: Application identity is not set.
at System.Deployment.Application.ApplicationDeployment.get_CurrentDeployment()
at System.Deployment.Application.ApplicationDeployment.get_CurrentDeployment()
at ClickOnce.Form1.Form1_Load(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50215.44 (beta2.050215-4400)
CodeBase:file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50215/mscorlib.dll
-
ClickOnce
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase:file:///C:/Program%20Files/IMS/ClickOnceSetup/ClickOnce.exe
-
Microsoft.VisualBasic
Assembly Version: 8.0.0.0
Win32 Version: 8.0.50215.44 (beta2.050215-4400)
CodeBase:file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
-
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50215.44 (beta2.050215-4400)
CodeBase:file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
-
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50215.44 (beta2.050215-4400)
CodeBase:file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
-
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50215.44 (beta2.050215-4400)
CodeBase:file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
-
System.Configuration
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50215.44 (beta2.050215-4400)
CodeBase:file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
-
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50215.44 (beta2.050215-4400)
CodeBase:file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
-
System.Runtime.Remoting
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50215.44 (beta2.050215-4400)
CodeBase:file:///C:/WINDOWS/assembly/GAC_MSIL/System.Runtime.Remoting/2.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
-
System.Data
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50215.44 (beta2.050215-4400)
CodeBase:file:///C:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
-
System.Deployment
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50215.44 (beta2.050215-4400)
CodeBase:file:///C:/WINDOWS/assembly/GAC_MSIL/System.Deployment/2.0.0.0__b03f5f7f11d50a3a/System.Deployment.dll
-
System.Transactions
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50215.44 (beta2.050215-4400)
CodeBase:file:///C:/WINDOWS/assembly/GAC_32/System.Transactions/2.0.0.0__b77a5c561934e089/System.Transactions.dll
-
System.EnterpriseServices
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50215.44 (beta2.050215-4400)
CodeBase:file:///C:/WINDOWS/assembly/GAC_32/System.EnterpriseServices/2.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll
-
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

