The Default Response File vbcrsp

The final point to be made regarding response files is that the VB 2008 compiler has an associated default response file (vbc.rsp), which is located in the same directory as vbc.exe itself (e.g., C:\Windows\Microsoft.NET\Framework\v3.5). If you were to open this file using Notepad, you would find that numerous .NET assemblies have already been specified using the /r: flag. As you would expect, you will come to understand the role of many of these .NET libraries over the course of the text. However, to set the stage, here is a look within vbc.rsp:

# This file contains command-line options that the VB

# command-line compiler (VBC) will process as part

# of every compilation, unless the "/noconfig" option

# is specified.

# Reference the common Framework libraries











/r:System.Drawing.Design.dll /r:System.Drawing.dll

/r:System.EnterpriseServices.dll /r:System.Management.dll /r:System.Messaging.dll /r:System.Runtime.Remoting.dll























# Import System and Microsoft.VisualBasic






Note Understand that the default response file is only referenced when working with the command-line compiler. The Visual Basic 2008 Express and Visual Studio 2008 IDEs do not automatically set references to these libraries.

When you are building your VB 2008 programs using vbc.exe, this file will be automatically referenced, even when you supply a custom *.rsp file. Given the presence of the default response file, the current TestApp.exe application could be successfully compiled using the following command set (as System.Windows.Forms.dll is referenced within vbc.rsp):

vbc /out:TestApp.exe *.vb

In the event that you wish to disable the automatic reading of vbc.rsp, you can specify the /noconfig option:

vbc @TestApp.rsp /noconfig

Obviously, the VB 2008 command-line compiler has many other options that can be used to control how the resulting .NET assembly is to be generated. At this point, however, you should have a handle on the basics. If you wish to learn more details regarding the functionality of vbc.exe, search the .NET Framework 3.5 documentation for the term "vbc.exe".

Source Code The VbcExample project is included under the Chapter 2 subdirectory.

Was this article helpful?

0 0

Post a comment