|
Google says...
System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
...you can determine the version of your application in the AssemblyInfo.cs file which may be found in the Properties folder of your solution (VS 2010)
EDIT: Slight correction of Google found code
Illogical thoughts make me ill
|
|
|
|
|
Thanks for your reply. I already have gotten it, google is the best friends of mine since I started programming. I still don't get it why I am getting asm version
1.0.0.0 where I see is 1.0.7. I have a installer what does it means project and installer will have two different assembly version.
thanks,
|
|
|
|
|
In your solution you will find a file called AssemblyInfo.cs in the properties folder. This file will contain an "AssemblyVersion" property which determines the actual version of the assembly (this will be the value you get if you use my suggested code)
I don't use VS for installers but I imagine the installer version is simply there as a sort of "release version" value - i.e. it is up to you to pick this, and would probably make sense for you to set it the same as your assembly version (this paragraph is speculation as I said I do not use VS installer wizard thingy)
e.g. you may choose to have the following...
Assembly Version = 1.2.3.4
Installer Version = 1.2 (don't need to show the rest is you only ever release minor build changes)
Illogical thoughts make me ill
|
|
|
|
|
You can get the version for the application with Application.ProductVersion[^].
For an individual assembly you can use something like
Assembly.GetExecutingAssembly().GetName().Version
which may, or may not give the same result as the first suggestion.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
I wouldn't let CG touch my Abacus!
When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is.
|
|
|
|
|
The are two version properties in the AssemblyInfo.cs file...
AssemblyVersion - which is returned by your second suggestion (code)
AssemblyFileVersion - which is returned by your first suggestion (link)
Illogical thoughts make me ill
|
|
|
|
|
Which may, or may not be the same, depending on how they have been set.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
I wouldn't let CG touch my Abacus!
When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is.
|
|
|
|
|
...Oh I see, that was a statement of knowledge rather than of query
Illogical thoughts make me ill
|
|
|
|
|
See here[^] for sample code to extract the details.
I must get a clever new signature for 2011.
|
|
|
|
|
Hi,
Can you let me know the sample to create xml file using SAX parser. Thanks in advance
|
|
|
|
|
You were told here[^] that .net doesn't use a SAX parser out the box. The equivalent is XmlReader , but this only reads. You can use XmlDocument , XmlWriter to write or you can directly serialize/deserialize and object. Which is easiest depends upon what is exactly needed.
|
|
|
|
|
I have an vs2008 Installation package, and i want to create a patch for it.
Please cand somebody help me out?
Thank you.
|
|
|
|
|
how i can find cd is readable and dvd is writable or not
and how reset these properties.
plz explain with example.
thanx ...............
|
|
|
|
|
Aisha sharma wrote: plz explain with example
...plz explain with question
Do you mean actual CD/DVD or Drives?
And what do you mean by 'reset these properties'?
Illogical thoughts make me ill
|
|
|
|
|
yes i want get information about actual cd and dvd e.i.
cd/dvd readable or writable
and want to give rights to user so that he can block
readOnly or writeOnly accesstypes
|
|
|
|
|
Hi there,
I've got a real annoying issue with an extremely simple .net application (C#, .net3.5).
What I have is a simple program (comparable to Hello World) which launches a thread to periodically read an xml file and stores some values into memory which are used by the main app thread. The main application thread just looks for mouse events on a traybar-icon which open a webbrowser with a specific url. That's it.
What the problem is, is that on my dev-machines and home computers the app runs nicely for hours/days straight. On my work-pc, the application seems to enter in a blocked state on the main execution thread or it enters a deadlock/filelock or something after a few minutes and stops responding and the process has to be killed via the taskmanager. This only happens on my work-machine which is Windows XP with .net4.0 installed. All other machines are also windows XP (any flavor) with .net3.5 installed. No error windows or logging present.
I'm at a total loss here. I ran through the code numerous times and checked all IO/Threading routines, but no loose ends found. Any ideas what it might be? Could it be the 4.0 runtime? (which I seriously doubt)
A good programmer is someone who always looks both ways before crossing a one-way street. (Doug Linder)
|
|
|
|
|
there is insufficient information.
is it a WinForm app? if so, is another thread trying to access some of the Controls?
do you have proper exception handling? are all exceptions caught and logged? are you swallowing some?
when it blocks, is the CPU load near zero? or rather near one fully occupied core?
Helfdane wrote: an extremely simple .net application
so why not show all relevant code?
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Fair questions, my bad for the insufficient info. I can't access the sources from this machine and I'm not going to type it over
It's a windows application. The values read from the xml are used to populate a context menu on a traybar icon. So, there is the main app-thread which reads values from a class (GetValues()) and uses those values to build a contextmenustrip. There is one thread which reads an xml-file and stores the values into memory (properties of the value-class). (polls an xml file for updates)
Cpu load is 0% at all times, the application is too small to notice it on a dualcore. Memory usage is 21kb.
But if this was a logic-issue, I should have problems on all machines, not just one of the 5. The only thing different between those machines is that the one machine which hangs the app has .net4.0 runtime installed, the others are still on 3.5. So, hence my question
A good programmer is someone who always looks both ways before crossing a one-way street. (Doug Linder)
|
|
|
|
|
As you are not touching any GUI parts from a thread other than the main thread, it sounds like a deadlock; you seem to have a producer-consumer relation between two threads, possibly there is insufficient synchronization. Maybe you are sharing several data items, and a thread switch occurs when the shared data is in an inconsistent state. Maybe you allowed for a compiler optimization that isn't correct (e.g. lacking a volatile keyword).
OTOH there have been some synchronization changes in .NET 4.0, IIRC they had to adapt a few things to cope with some potential deadlock the way things used to be handled internally. There also is a new "cancellation model". I don't have a reference, and I never saw an actual victim of the old ways. This[^] is something a quick Google brought up, not sure it is related though.
I would consider it more likely the problem is in your code itself. It working properly all the time on some machines, and quite some time on the one, does not prove a thing. Bugs don't have to show themselves all the time, that would be too easy...
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Thanks for the tip. I'll take a look at it.
A good programmer is someone who always looks both ways before crossing a one-way street. (Doug Linder)
|
|
|
|
|
Helfdane wrote: I can't access the sources from this machine and I'm not going to type it over
Post a relevant snippet demonstrating the problem when you do have access. I'm not going to hunt for something without a map.
Helfdane wrote: But if this was a logic-issue, I should have problems on all machines
Why? Some logical errors only become visible under specific circumstances.
Helfdane wrote: The only thing different between those machines is that the one machine which hangs the app has .net4.0 runtime installed, the others are still on 3.5.
Is the app also compiled against 4.0, or is it running on the 3.5 framework?
Are you by any chance using WM_NCHITTEST on the trayicon?
I are Troll
|
|
|
|
|
Hi,
In my application am providing the access to the user to export the data from Grid to Excel,
After exporting the data to excel, it will save that file in user desktop and providing a option to open the file in my application by displaying a message in message box...
My question is, suppose if the user dont have excel installed in his machine and he clicks on open the downloaded file through my application, it will through an exception..
In that occasion i have to display message to the user to install the required application before opening the machine, in case if he dont have that application in his machine...
So could u tell me, how to do it....
|
|
|
|
|
Check the registry. In HKEY_CLASSES_ROOT, there should be an entry for the extension, and one or more sub-keys for the "type" (e.g. ".xls" with sub-key "Excel.Sheet.8"). Then look at the key for "Excel.Sheet.8", you will should see a sub-key "Open" and there a sub-key "command". If one of those keys cannot be found, a suitable application is not (correctly) installed.
|
|
|
|
|
Hi,
Am using the below code to check whether the excel is present in user machine or not...
if (MessageBox.Show(
"Data Exported to File " + strFileName +
" at location MyDocuments. Do yo want to view the saved file?",
"Work Done",
MessageBoxButton.YesNo,
MessageBoxImage.Information) == MessageBoxResult.Yes)
{
Type officeType = Type.GetTypeFromProgID("Excel.Application");
if (officeType == null)
{
MessageBox.Show("Please Install MS Excel 2007 or above version to view this file", "Liquidity Risk Management");
}
else
{
oXl.Visible = true;
}
}
Now, suppose if the user having lesser version of excel like excel 2003,he can able to see the see the file downloaded under the version on excel 2007, means irrespective of the excel version, it has to open the file if the user have a excel installed in his machine..
How to do it...
|
|
|
|
|
Or you can show the Open with dialog box:
Process p = new Process();
p.StartInfo.FileName = "rundll32.exe";
p.StartInfo.Arguments = "Shell32.dll,OpenAs_RunDLL " + filename;
p.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
p.Start();
|
|
|
|
|
Hi all,
I am trying to execute this line of code but it not providing me the values
ManagementObjectSearcher pd = new ManagementObjectSearcher("SELECT Name, MediaType, MediaDescription from Win32_PhysicalMedia");
foreach (ManagementObject mp in pd.Get())
richTextBox3.Text += mp["Name"] + " " + mp["MediaType"] + " " + mp["MediaDescription"];
Can anybody please tell me what i am doing wrong or if i need to include something in this...
mainly i want to find media type...
Thanks in advance
|
|
|
|