|
#1
|
|||
|
|||
C# Pre-Build step corrupted by Visual Build
If a C# project (using VS.NET 2003) has a pre-build step defined which contains quotes (e.g. dir "c:\windows") and you have 'Set the base address to a random value if not set' selected in the Visual Build Step Properties on the Versions page, then Visual Build replaces the quotes in the project file with ';quote' (converts to valid xml).
Since the pre-build step is executed as a batch file, you get an invalid syntax. To get around the problem, I changed the Visual Build setting to 'No' since I don't think the option is doing anything for a C# project anyway. But it could pose a problem if my solution also contained C++ projects. |
#2
|
|||
|
|||
That is due to a bug in the VS.NET C# project file parser in that it doesn't properly parse a double quote char in the project file represented as " (the Make VS.NET action uses the .NET XMLDocument class to modify the base address in the project file, which also results in literal double quote chars in the file getting converted to " when saved).
Not using the base address option is the required workaround for C# and VB.NET projects. VC++.NET correctly writes (and parses) quote chars within project settings to the .vcproj file as " so it won't be a problem for C++ projects. You would need to put the C++ projects in a separate solution or create a C++-only solution and corresponding 'no build' Make VS.NET step to use the base address option. |
#3
|
|||
|
|||
Post build event also affected
Independent from the base address setting I get a mistake during the execution of the post build event.
In my case it seems to have problems with newline characters, too. So it says: Command "quot" is wrong or can't be found. Command "#xD" is wrong or can't be found. Command "#xA" is wrong or can't be found. Is there a workaround for this? |
#4
|
|||
|
|||
The Make VS.NET Action may also modify the project file if the 'Update the output directory' option on the Project/Solution tab is checked. A workaround might be to uncheck that as well (although I've never seen the error you report caused by VBP).
|
#5
|
|||
|
|||
Hmm, yes I have set the "Update output directory" flag... but I think I need that one.
Actually I don't want the post build steps to be performed. I just need them while working with VS.NET. When using VBP, the build script will perform the necessary steps. Perpaps you can introduce another checkbox like [ ] Skip post build event in one of the future versions. Maybe the messages I posted are not correct. I just translated them from the german version o VBP. |
#6
|
|||
|
|||
Attached is a project that fixes up the .csproj files after modification by VBP so that VS.NET loads build events properly.
|
|
|