Conditional compilation symbols that use string literals are not compiled by Vbc.exe (818217)
The information in this article applies to:
- Microsoft Visual Basic 2005
- Microsoft Visual Basic .NET (2003)
- Microsoft Visual Basic .NET (2002)
SYMPTOMSWhen your Visual Basic .NET or Visual Basic 2005 project contains conditional
compilation symbols that use string literals, the Visual Basic .NET or Visual Basic 2005 Command
Line Compiler (vbc.exe) may not compile the source code that is defined between
the conditional compilation symbols. The generated executable may not run as
expected.CAUSEWhen you use the /define switch for vbc.exe to provide string literals for conditional
compilation, vbc.exe expects string values to be entered between """ and """ (three pairs of quotation marks). When you enter the string
literals between double quotation marks, the conditional comparison fails, and
the code is not generated as expected.WORKAROUNDTo work around this problem, type each string literal at the
command line in two extra pairs of quotation marks. For example, type the
string literal "Hello" as """Hello""".
Note If you use response files to specify command line parameters,
prepend a backward slash mark (\) to the opening quotation mark and to the closing quotation mark
for each string literal. For example, type the string literal "Hello" as \"Hello\".STATUS This
behavior is by design.REFERENCESFor more information, visit the following MSDN Web
Sites:
Modification Type: | Minor | Last Reviewed: | 10/3/2006 |
---|
Keywords: | kbvs2005swept kbvs2005applies kbString kbCommandLine kbCodeGen kbCompiler kbConsole kbprb KB818217 kbAudDeveloper |
---|
|