471,316 Members | 1,081 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,316 software developers and data experts.

Display Publish Version Error


Error occurs on
"System.Deployment.Application.ApplicationDeployme nt.CurrentDeployment"
** Here is my code

private void frmMain_Load(object sender, System.EventArgs e)
{
System.Deployment.Application.ApplicationDeploymen t ad =
System.Deployment.Application.ApplicationDeploymen t.CurrentDeployment;
this.Text = "Dealer Sales " + ad.CurrentVersion;

}
** Here is the error message

System.Deployment.Application.InvalidDeploymentExc eption was unhandled
Message="Application is not installed."
Source="System.Deployment"
StackTrace:
at System.Deployment.Application.ApplicationDeploymen t..ctor(String
fullAppId)
at
System.Deployment.Application.ApplicationDeploymen t.get_CurrentDeployment()
at LicenseDealerSales.frmMain.frmMain_Load(Object sender, EventArgs
e) in C:\Documents and Settings\mikel\My Documents\Visual Studio
Projects\LicenseDealerSales\frmMain.cs:line 131
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(Mes sage& m)
at System.Windows.Forms.ContainerControl.WndProc(Mess age& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at
System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr hWnd,
Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.SendMessa ge(HandleRef
hWnd, Int32 msg, Int32 wParam, Int32 lParam)
at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
at System.Windows.Forms.Control.set_Visible(Boolean value)
at
System.Windows.Forms.Application.ThreadContext.Run MessageLoopInner(Int32
reason, ApplicationContext context)
at
System.Windows.Forms.Application.ThreadContext.Run MessageLoop(Int32 reason,
ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at LicenseDealerSales.frmMain.Main() in C:\Documents and
Settings\mikel\My Documents\Visual Studio
Projects\LicenseDealerSales\frmMain.cs:line 106
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)
at System.Runtime.Hosting.ManifestRunner.ExecuteAsAss embly()
at
System.Runtime.Hosting.ApplicationActivator.Create Instance(ActivationContext
activationContext, String[] activationCustomData)
at
System.Runtime.Hosting.ApplicationActivator.Create Instance(ActivationContext
activationContext)
at
Microsoft.VisualStudio.HostingProcess.HostProc.Run UsersAssemblyDebugInZone()
at System.Threading.ThreadHelper.ThreadStart_Context( Object state)
at System.Threading.ExecutionContext.Run(ExecutionCon text
executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

Feb 23 '06 #1
4 6246
You need to check ApplicationDeployment.IsNetworkDeployed; if this returns
false there is no publication to get an application version from - so the
best you can use is the assembly version via something like
System.Reflection.Assembly.GetEntryAssembly().GetN ame().Version

Marc
Feb 23 '06 #2
Hi Cadel,
Thanks for Marc's reply!

I just wanted to check how things are going and whether Marc's suggestion
is useful for you. If there is any question, please feel free to join the
community and we are here to support you at your convenience. Thanks for
your understanding!

Best Regards,

Terry Fei[MSFT]
Microsoft Community Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
Thread-Topic: Display Publish Version Error
thread-index: AcY4ktXA/ASPLjhKQMuzDVzXcMDU0w==
X-WBNR-Posting-Host: 204.87.106.66
From: =?Utf-8?B?TWlrZSBM?= <Ca***@nospam.nospam>
Subject: Display Publish Version Error
Date: Thu, 23 Feb 2006 08:04:32 -0800
Lines: 74
Message-ID: <85**********************************@microsoft.co m>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.languages.csharp
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.dotnet.languages.csharp:387990
X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
Error occurs on
"System.Deployment.Application.ApplicationDeploym ent.CurrentDeployment"
** Here is my code

private void frmMain_Load(object sender, System.EventArgs e) {
System.Deployment.Application.ApplicationDeploymen t ad =
System.Deployment.Application.ApplicationDeployme nt.CurrentDeployment;
this.Text = "Dealer Sales " + ad.CurrentVersion;

}
** Here is the error message

System.Deployment.Application.InvalidDeploymentEx ception was unhandled
Message="Application is not installed."
Source="System.Deployment"
StackTrace:
at System.Deployment.Application.ApplicationDeploymen t..ctor(String
fullAppId)
at
System.Deployment.Application.ApplicationDeployme nt.get_CurrentDeployment()
at LicenseDealerSales.frmMain.frmMain_Load(Object sender, EventArgs
e) in C:\Documents and Settings\mikel\My Documents\Visual Studio
Projects\LicenseDealerSales\frmMain.cs:line 131
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(Mes sage& m)
at System.Windows.Forms.ContainerControl.WndProc(Mess age& 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.W ndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr hWnd,Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.SendMessa ge(HandleRef
hWnd, Int32 msg, Int32 wParam, Int32 lParam)
at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
at System.Windows.Forms.Control.set_Visible(Boolean value)
at
System.Windows.Forms.Application.ThreadContext.Ru nMessageLoopInner(Int32
reason, ApplicationContext context)
at
System.Windows.Forms.Application.ThreadContext.Ru nMessageLoop(Int32 reason,ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at LicenseDealerSales.frmMain.Main() in C:\Documents and
Settings\mikel\My Documents\Visual Studio
Projects\LicenseDealerSales\frmMain.cs:line 106
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args) at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)
at System.Runtime.Hosting.ManifestRunner.ExecuteAsAss embly()
at
System.Runtime.Hosting.ApplicationActivator.Creat eInstance(ActivationContex tactivationContext, String[] activationCustomData)
at
System.Runtime.Hosting.ApplicationActivator.Creat eInstance(ActivationContex tactivationContext)
at
Microsoft.VisualStudio.HostingProcess.HostProc.Ru nUsersAssemblyDebugInZone( ) at System.Threading.ThreadHelper.ThreadStart_Context( Object state)
at System.Threading.ExecutionContext.Run(ExecutionCon text
executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()


Feb 27 '06 #3
The code brought a number back, but I don't know what it is.
I have the publish version set to 1.0.8.0 but the code brings back
1.0.2249.26117
My new code.

this.Text = "Dealer Sales " +
System.Reflection.Assembly.GetEntryAssembly().GetN ame().Version.ToString();
"Marc Gravell" wrote:
You need to check ApplicationDeployment.IsNetworkDeployed; if this returns
false there is no publication to get an application version from - so the
best you can use is the assembly version via something like
System.Reflection.Assembly.GetEntryAssembly().GetN ame().Version

Marc

Feb 27 '06 #4
Hi Cadel,
Thanks for your response!

The version is composed by four parts. They are Major Version, Minor
Version, Build Number and Revision Number. Based on my knowledge, we can
ignore Build Number and Revision Number. In another word, if Major Version
and Minor Version are equal, these two versions are match. In your current
situation, Major Version and Minor Version of "1.0.8.0" is 1 and 0; Major
Version and Minor Version of "1.0. 2249.26117" is also 1 and 0. So you can
think these two versions are same.

I hope the above information is helpful for you. Thanks for your
understanding!

Best Regards,

Terry Fei [MSFT]
Microsoft Community Support
Get Secure! www.microsoft.com/security

--------------------
Thread-Topic: Display Publish Version Error
thread-index: AcY73Vf3er5uhAVdRhqWSiFc3DuhRQ==
X-WBNR-Posting-Host: 204.87.106.66
From: =?Utf-8?B?TWlrZSBM?= <Ca***@nospam.nospam>
References: <85**********************************@microsoft.co m> <Oj**************@TK2MSFTNGP09.phx.gbl>Subject: Re: Display Publish Version Error
Date: Mon, 27 Feb 2006 12:35:27 -0800
Lines: 22
Message-ID: <8F**********************************@microsoft.co m>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.languages.csharp
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.dotnet.languages.csharp:388737
X-Tomcat-NG: microsoft.public.dotnet.languages.csharp

The code brought a number back, but I don't know what it is.
I have the publish version set to 1.0.8.0 but the code brings back
1.0.2249.26117
My new code.

this.Text = "Dealer Sales " +
System.Reflection.Assembly.GetEntryAssembly().Get Name().Version.ToString();
"Marc Gravell" wrote:
You need to check ApplicationDeployment.IsNetworkDeployed; if this returns false there is no publication to get an application version from - so the best you can use is the assembly version via something like
System.Reflection.Assembly.GetEntryAssembly().GetN ame().Version

Marc


Feb 28 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Sushil Prasad | last post: by
5 posts views Thread by NoNickname | last post: by
1 post views Thread by Bill Long | last post: by
7 posts views Thread by Mike L | last post: by
2 posts views Thread by Todd | last post: by
10 posts views Thread by WT | last post: by
2 posts views Thread by Vayse | last post: by
3 posts views Thread by =?Utf-8?B?Sm9obiBT?= | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.