473,387 Members | 1,863 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,387 software developers and data experts.

Visual Studio 2003 Post Build event multi-line format issues

I am using PostBuild events in a C# project to run some tasks, but only
when in release configuration mode. The build events run perfectly as
expected when run. The problem comes when I save the project, close
VS, and reopen VS and the project.

When I build again, i get a post-build event error. So I open the
event to look at it. Guess what, it is not the post-build event i
saved. Instead all the carriage returns are replaced with 
.
and line feeds with 
. This is proper formatting for saving to
xml format from what I can tell. However, visual studio should parse
that format into the orginal format when the project opens.

What can I do? Is it too late to get a service pack for VS2003 now
that Visual Studio 2005 is out?

here is a partial of my orginal post-build event. I left out a bunch
of calls to xcopy release files around.
IF NOT $(ConfigurationName) == Release GOTO end

call "C:\Program Files\XHEO\CodeVeil\v1.0\cve.exe" /project
$(ProjectDir)$(TargetName).cvp

:end
echo Finished Post Build Event

I use the same post-build event text for all my projects in the
solution. That's why I use variables. I have a separate "cvp" file
for each project.

I tried hardcoding paths and putting them in an external batch file
that I called in the post-build event. But to call that just in
release mode I still needed the IF statement, and thus multiple lines.
This still has the same formatting issue.

Anyone have a workaround? Anyone know if this is fixed in VS2005?

Michael Lang

Feb 8 '06 #1
3 11268
Well, I found a workaround. I would still rather the VS2003 team
released a patch for this. The workaround adds more file maintenance
to the devlopment cycle.

1) create a separate batch file for each configuration. The
configuration name must be a part of the file name. Example:
PostBuildRelease.bat and PostBuildDebug.bat.

You need to have a file for each configuration, even if you don't want
to do anything for that configuration. Otherwise you'll get build
errors.

2) Set the post-build event text to build the name of the bat file and
call it. Example:
call $(ProjectDir)PostBuild$(ConfigurationName).bat

That's it. But now I have a more busy batch file to maintain. My
Debug btach file just echo's that it is complete. But the release one
is more like this...

call "C:\Program Files\XHEO\CodeVeil\v1.0\cve.exe" /project
C:\ProjectRoot\MySolution\MyProject\ProjectName.cv p
echo Post Build Event Complete

I also can't reuse the same text for the build events of all the
projects. If the project is deployed to a different working folder on
another developers machine, the build event won't work for them. Each
developer would have to maintain their own batch files, or the team has
to enforce the same working folder location. Neither is a good option.

I hope there is a better workaround!

Michael Lang

Feb 8 '06 #2
I also use multiline post-build events in my solution, but I never had this
kind of problem. It works perfectly for me.
We have a lot of projects that uses exactly the same post-build script.
What I do is to create an environment variable that holds some Visual Studio
environment information (set CONFIGURATION=$(Configuration), and, if
necessary, you can place two commands in the same line using the && command.

set CONFIGURATION=$(Configuration) && ($ProjectDir)\PostBuild.cmd

or

set CONFIGURATION=$(Configuration) && set WHATEVER=($Whatever) &&
($ProjectDir)\PostBuild.cmd

and so on...

<mi**********@xquisoft.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
I am using PostBuild events in a C# project to run some tasks, but only
when in release configuration mode. The build events run perfectly as
expected when run. The problem comes when I save the project, close
VS, and reopen VS and the project.

When I build again, i get a post-build event error. So I open the
event to look at it. Guess what, it is not the post-build event i
saved. Instead all the carriage returns are replaced with &amp;#xD;.
and line feeds with &amp;#xA;. This is proper formatting for saving to
xml format from what I can tell. However, visual studio should parse
that format into the orginal format when the project opens.

What can I do? Is it too late to get a service pack for VS2003 now
that Visual Studio 2005 is out?

here is a partial of my orginal post-build event. I left out a bunch
of calls to xcopy release files around.
IF NOT $(ConfigurationName) == Release GOTO end

call "C:\Program Files\XHEO\CodeVeil\v1.0\cve.exe" /project
$(ProjectDir)$(TargetName).cvp

:end
echo Finished Post Build Event

I use the same post-build event text for all my projects in the
solution. That's why I use variables. I have a separate "cvp" file
for each project.

I tried hardcoding paths and putting them in an external batch file
that I called in the post-build event. But to call that just in
release mode I still needed the IF statement, and thus multiple lines.
This still has the same formatting issue.

Anyone have a workaround? Anyone know if this is fixed in VS2005?

Michael Lang

Feb 8 '06 #3
Michael,

This might be unrelated to your question, but since you are using
protection tools for your .NET applications, you may want to take a
look of my DeProtector sample with full source code before shipping
ypur products. It explains the mechanims howl whole assembly encryption
is failed to protect intellectual properties. Theis simple DeProtector
defeats all current protection tools on the market, whether it's
anti-debug or not.

http://www.remotesoft.com/deprotector

Huihong
mi**********@xquisoft.com wrote:
I am using PostBuild events in a C# project to run some tasks, but only
when in release configuration mode. The build events run perfectly as
expected when run. The problem comes when I save the project, close
VS, and reopen VS and the project.

When I build again, i get a post-build event error. So I open the
event to look at it. Guess what, it is not the post-build event i
saved. Instead all the carriage returns are replaced with &amp;#xD;.
and line feeds with &amp;#xA;. This is proper formatting for saving to
xml format from what I can tell. However, visual studio should parse
that format into the orginal format when the project opens.

What can I do? Is it too late to get a service pack for VS2003 now
that Visual Studio 2005 is out?

here is a partial of my orginal post-build event. I left out a bunch
of calls to xcopy release files around.
IF NOT $(ConfigurationName) == Release GOTO end

call "C:\Program Files\XHEO\CodeVeil\v1.0\cve.exe" /project
$(ProjectDir)$(TargetName).cvp

:end
echo Finished Post Build Event

I use the same post-build event text for all my projects in the
solution. That's why I use variables. I have a separate "cvp" file
for each project.

I tried hardcoding paths and putting them in an external batch file
that I called in the post-build event. But to call that just in
release mode I still needed the IF statement, and thus multiple lines.
This still has the same formatting issue.

Anyone have a workaround? Anyone know if this is fixed in VS2005?

Michael Lang


Feb 9 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Corrie Meyer | last post by:
Announcement: SwiftReports standard edition 1.0 for Visual Studio ..NET 2003 released by UniSwift. We are pleased to announce the first release of a fully-managed reporting tool for the...
5
by: gj | last post by:
I'm working on a build environment for .NET application where the developers are using visual studio and VSS. In order to pull only the changed modules (and any required dependencies) I want to...
0
by: Joel Just Joel | last post by:
Good day, dotnet.general Folks, I'm not sure if this is the correct forum for posting general Visual Studio ..NET questions, but I hope so. If not, please forgive and tell me where to post...
0
by: tel4 | last post by:
Microsoft Visual Studio Tools for the Microsoft Office System 2003 Microsoft Corp. DATE......: 03-10-2003 TYPE......: Application OS........: WinALL DiSKS.....: xx/02 PROTECTiON : NONE/RETAiL...
26
by: Bruno Jouhier [MVP] | last post by:
I'm currently experiencing a strange phenomenon: At my Office, Visual Studio takes a very long time to compile our solution (more than 1 minute for the first project). At home, Visual Studio...
1
by: Ramen | last post by:
After my Build, a file gets generated "a.txt". I want to open "a.txt" as a Post-Build Event on Visual.NET window (like doing a File>Open>File). I know I can launch wordpad or notepad as a...
2
by: Ney André de Mello Zunino | last post by:
Hello. I gladly learned yesterday that Microsoft was making the Visual C++ Toolkit 2003 available for free. Today, I downloaded and installed it and went on to try building some simple...
21
by: Paul Tremblay | last post by:
Hi All, I am a veteran C/C++ programmer (Unix background) and I want to get to speed with Visual Studio .Net I have legacy C/C++ code that I want to use in my application. However, I'm not...
9
by: slimicus | last post by:
The IDE crashes about every 10-20 minutes for me.. its been doing this ever since I started this project (The project was a 2003 project but I recreated it in 2005) When it crashes, its...
1
by: sundarvenkata | last post by:
Is multi-targeting possible using Visual Studio Express? If not, do I have any other options to target a 1.1 framework using Visual Studio Express? Thanks for your help, Sundar
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
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.