473,378 Members | 1,312 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 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 6342
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Sushil Prasad | last post by:
I am having problem in displaying the compiled help file. In asp.net app I have link button labeled help. On the users click of this button i do the respose.redirect to the url of the .chm file....
5
by: NoNickname | last post by:
Basically, how do I know that the release versions of all components are being published? The Build | Configuration Manager is confusing me a little in VS2005. I have three projects in my...
1
by: Bill Long | last post by:
I have a .NET 1.1 application (C#) that I converted to .NET 2.0... Conversion was pretty painless, code runs from the development environment no problem... but when I try and publish... It says...
7
by: Mike L | last post by:
I want frmMain.text to show the current publish version. What is the code to get the current publish version? For example. frmMain.text = "My Application Version: " & project.publish.version ...
2
by: Todd | last post by:
My web site compiles fine. Tihs was a VS 2003 working application that was converted to VS 2005. When I try to publish to a directory I get a "Data at the root level is invalid." error in the...
10
by: WT | last post by:
Hello, I have been publishing my web site many times to the remote where resides my final web site. Everything was ok, but to-day, without any configuration change, vs doesn't copy final files...
2
by: Vayse | last post by:
On my Help/About screen, I'd like to display 1) The version number, as it appears in the Publish screen. 2) The version number of the Report Viewer control. How would I do this? Thanks Vayse
4
by: Pieter | last post by:
Hi, We're using ClickOnce alreaddy more than a year for a given applicaiton, doing more than 50 publishes without any problem. Yesterday we made a minor change to one of our components (let's...
3
by: =?Utf-8?B?Sm9obiBT?= | last post by:
Hi, I'm trying to publish a new web service that I've written. It's fine when I publish it on the local PC but I get Publish failed in the development environment when I try to publish it to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.