|
aha... thanks for the answer, Mark.
I have to select the install project and then the properties tab in order to get the list of project properties (right clicking and selecting properties brings up a dialog with nothing relevant). In the list of project properties I can specify a post-build event, which brings up a dialog with these three macros:
$(BuiltOuputPath)
$(Configuration)
$(ProjectDir)
which are, in turn,
c:\...\folder\debug\applicationname.msi
Debug
c:\...\folder\
So I could write something like
rename $(BuiltOuputPath) $(ProjectDir)$(Configuration)\appliactionname <version>.msi
which would expand to
rename c:\...\folder\debug\applicationname.msi c:\...\folder\debug\applicationname <version>.msi
but how do I retrieve the version number here ? If I have to change the post build macro each time I change version I might as well just change the filename manually
/Jan
Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert
|
|
|
|
|
You have to get a little more creative, think outside teh macro box.
Write a script(WSH) or simple console app that can be called from the post build event which will read the file for version infor and update the msi file name.
only two letters away from being an asset
|
|
|
|
|
I see.. No built in support for this kind of advanced scheme ) Strange that you can't get project properties like version in the macro.
However, no matter how much out of the macro box I think, I still cant see how I can retrieve the project version number from the msi file. Got any ideas for that ?
Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert
|
|
|
|
|
I use singleton pattern to connect to a database and sql sentences , but the string connections read one time from an xml file when i do new SingletonClass().
Is this safe?? cos the string connection that i read, is stored on a private attributte of the singleton class.
and the next times that i want to access to database i dont read the xml with the parameters to the string connection,i use the string var with the string connections.
thanks
God make a perfect team, the rest have foreigners, Athletic Club Bilbao
|
|
|
|
|
Legolas.Bilbao wrote: Is this safe??
Are you worried about the connection string being stored in an xml file on the disk ?
|
|
|
|
|
worried about string connection had stored on memory its a problem or not? maybe its a paranoic question
Dios creo un equipo perfecto a los demas los lleno de extranjeros
|
|
|
|
|
in my application I want to try delete an image file.. but at every attempt I get an
[System.IO.IOException] {"The process cannot access the file '..\\addAll.png' because it is being used by another process."}
I am sure that this file is not in use because I just dispose the Image object using this file with :
((PictureBox)flowLayoutPanelThumbs.Controls[0]).Image.Dispose();
flowLayoutPanelThumbs.Controls.RemoveAt(1)İ
1-Why occurs this cannot access bla bla bla error and how can I avoid this?
2-How can I find the process using this file
I will REALLY appreciate any help..
thanks and best regards
.:: Something is Wrong ::.
|
|
|
|
|
Use this tool: Process Explorer [^] to find which process is holding the handle to the mentioned file.
|
|
|
|
|
As suhredayan suggested, first check if some other process is holding open a handle to the file. If it's your process, how are you creating the Image object? I vaguely remember there being a bug in the framework that caused this problem if the Image instance is created using Image.FromFile . If you're using Image.FromFile, you could try Image.FromStream instead.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
If you load an image yourself, then the file handle stays open until you call dispose. If you've called dispose, you should be able to save it. The answer often is if you use FromFile, to make a copy, keep the copy and dispose of the original right away.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thanks for the answers.. As you guessed the FileHandle stays open so I taked a copy and Dispose the orignal one..
rule 1 : always use "using(.....){ }" when you are working with object that needs to be closed by hand
Thanks a lot..
.:: Something is Wrong ::.
|
|
|
|
|
1. Can I make my own skin for C#.net app as i see GUI of professional app?
2. How to make it? What function or class?
3. Could u give me some example ?
AAA
|
|
|
|
|
|
I'll try to be brief...
Problem:
Using standard (de)serialization I'm saving the contents of a multiline textbox into a few different string variables (depending on which option the user has selected), which are then being saved into an XML document.
Upon reading the values from the XML files and displaying them into the textbox the actual linebreaks are being replaced by a square (which is actually char 13). This is making no sense to me. The textboxes are set to multiline, and if I use a rich textbox control instead of a standard textbox control it works fine.
If I take the square character and paste it into notepad or the VS IDE it creates an actual line break.
Why is this happening and how can I fix it? I'm stumped.
|
|
|
|
|
In the string being displayed, replace \n with \r\n and it should work as you expect (or it might be \n\r I can't remember which!)
|
|
|
|
|
Some systems use a single character (10) as line break, while DOS/Windows uses two characters (13, 10).
You can fix any "funky" line breaks with:
theString = Regex.Replace(theString, @"\r?\n", Environment.NewLine);
This code works regardless of the type of linebreak the current system is using, and it doesn't mess up line breaks in the string that already are correct.
-- modified at 3:18 Thursday 24th August, 2006
Made a correction about what characters are used, and changed the regular expression pattern accordingly.
---
b { font-weight: normal; }
|
|
|
|
|
Thanks. This didn't work directly, but after making it search for just "\n" and replace it with an Env.NewLine that did work.
Strange...
|
|
|
|
|
Right. The square characters that you have is not the carrage return (char 13), but line feed (char 10). I have corrected the code that I posted earlier.
---
b { font-weight: normal; }
|
|
|
|
|
Hi all,
I have a program that generates some HTML and then needs to automatically print it. This automatic printing occurs within a separate thread (timer) and for the life of me, I just can't get it working.
After a couple of days Googling around, I found a couple of things:
1) Attempting to do it calling IE (or the equivalent DLLs) isn't an option since it'll always pop up a print dialog box and there's nothing that can be done about that.
2) webBrowser1.Print() should work, but doesn't. It doesn't call an exception, it doesn't have any problems, but it also doesn't print. I'm assuming it's related to the fact that this is all in a separate thread from the timer.
3) If I attempt to be "messy" and just call a complete new thread that creates the webbrowser object, loads the HTML and print it, it gives an exception complaining it's not STA, even though I did set it that way.
So basically, I'm fairly stuck at this point. Here's the code I've tried so far minus the messy one, since that's definitely barking up the wrong tree I think. (note that the html is both in my webbrowser object or in the file - I'd love to not have to use the webbrowser object if I can get away with it)
<br />
<br />
<br />
<br />
<br />
Ben de Waal
|
|
|
|
|
To clarify further, this code:
YttriumOxide wrote: /* //This doesn't work - maybe because of the thread?
*
* webBrowser1.Navigate(szTempFolder + @"\Temp\Body.html");
* webBrowser1.Print();
*/
DOES succesfully do the webBrowser1.Navigate, but NOT the webBrowser1.Print - which is extremely confusing in my books... Why does Navigate work inside a seperate thread, but not Print?
Ben de Waal
|
|
|
|
|
Hello all,
I wonder if any of you have found/written a free Ribbon Control (the office 2007 style)?
I found some ribbon controls while googling but none of them are free (not even for non-commercial use).
Regards,
Pawel
|
|
|
|
|
I have a c# exe that must tranfere files from one server to another. Well it works perfectly when I am logged on remotely to the server but if I am not logged on it give an error saying it counl not find the destination drive.
How can I make it to run while I am not logged on?
|
|
|
|
|
If you are referring to the remote system's file system using a mapped drive then don't. Refer to it using a UNC path name.
|
|
|
|
|
Could you please explain further. I am not an expert in C#(still learning).
|
|
|
|
|
Colin is suggesting you directly use the UNC[^] notation, instead of mapping a drive to that location. You typically would have used the UNC path to setup the mapping in the first place.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|