Error occurs on
"System.Deploym ent.Application .ApplicationDep loyment.Current Deployment"
** Here is my code
private void frmMain_Load(ob ject sender, System.EventArg s e)
{
System.Deployme nt.Application. ApplicationDepl oyment ad =
System.Deployme nt.Application. ApplicationDepl oyment.CurrentD eployment;
this.Text = "Dealer Sales " + ad.CurrentVersi on;
}
** Here is the error message
System.Deployme nt.Application. InvalidDeployme ntException was unhandled
Message="Applic ation is not installed."
Source="System. Deployment"
StackTrace:
at System.Deployme nt.Application. ApplicationDepl oyment..ctor(St ring
fullAppId)
at
System.Deployme nt.Application. ApplicationDepl oyment.get_Curr entDeployment()
at LicenseDealerSa les.frmMain.frm Main_Load(Objec t sender, EventArgs
e) in C:\Documents and Settings\mikel\ My Documents\Visua l Studio
Projects\Licens eDealerSales\fr mMain.cs:line 131
at System.Windows. Forms.Form.OnLo ad(EventArgs e)
at System.Windows. Forms.Form.OnCr eateControl()
at System.Windows. Forms.Control.C reateControl(Bo olean fIgnoreVisible)
at System.Windows. Forms.Control.C reateControl()
at System.Windows. Forms.Control.W mShowWindow(Mes sage& m)
at System.Windows. Forms.Control.W ndProc(Message& m)
at System.Windows. Forms.Scrollabl eControl.WndPro c(Message& m)
at System.Windows. Forms.Container Control.WndProc (Message& m)
at System.Windows. Forms.Form.WmSh owWindow(Messag e& m)
at System.Windows. Forms.Form.WndP roc(Message& m)
at
System.Windows. Forms.Control.C ontrolNativeWin dow.OnMessage(M essage& m)
at System.Windows. Forms.Control.C ontrolNativeWin dow.WndProc(Mes sage& m)
at System.Windows. Forms.NativeWin dow.DebuggableC allback(IntPtr hWnd,
Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows. Forms.UnsafeNat iveMethods.Send Message(HandleR ef
hWnd, Int32 msg, Int32 wParam, Int32 lParam)
at System.Windows. Forms.Form.SetV isibleCore(Bool ean value)
at System.Windows. Forms.Control.s et_Visible(Bool ean value)
at
System.Windows. Forms.Applicati on.ThreadContex t.RunMessageLoo pInner(Int32
reason, ApplicationCont ext context)
at
System.Windows. Forms.Applicati on.ThreadContex t.RunMessageLoo p(Int32 reason,
ApplicationCont ext context)
at System.Windows. Forms.Applicati on.Run(Form mainForm)
at LicenseDealerSa les.frmMain.Mai n() in C:\Documents and
Settings\mikel\ My Documents\Visua l Studio
Projects\Licens eDealerSales\fr mMain.cs:line 106
at System.AppDomai n.nExecuteAssem bly(Assembly assembly, String[] args)
at System.Runtime. Hosting.Manifes tRunner.Run(Boo lean checkAptModel)
at System.Runtime. Hosting.Manifes tRunner.Execute AsAssembly()
at
System.Runtime. Hosting.Applica tionActivator.C reateInstance(A ctivationContex t
activationConte xt, String[] activationCusto mData)
at
System.Runtime. Hosting.Applica tionActivator.C reateInstance(A ctivationContex t
activationConte xt)
at
Microsoft.Visua lStudio.Hosting Process.HostPro c.RunUsersAssem blyDebugInZone( )
at System.Threadin g.ThreadHelper. ThreadStart_Con text(Object state)
at System.Threadin g.ExecutionCont ext.Run(Executi onContext
executionContex t, ContextCallback callback, Object state)
at System.Threadin g.ThreadHelper. ThreadStart()
Comment