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:Accessibility.dll

/r:Microsoft.Vsa.dll

/r:System.Configuration.dll

/r:System.Configuration.Install.dll

/r:System.Data.dll

/r:System.Data.OracleClient.dll

/r:System.Deployment.dll

/r:System.Design.dll

/r:System.DirectoryServices.dll

/r:System.dll

/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

/r:System.Runtime.Serialization.Formatters.Soap.dll

/r:System.Security.dll

/r:System.ServiceProcess.dll

/r:System.Transactions.dll

/r:System.Web.dll

/r:System.Web.Mobile.dll

/r:System.Web.RegularExpressions.dll

/r:System.Web.Services.dll

/r:System.Windows.Forms.Dll

/r:System.XML.dll

/r:System.Workflow.Activities.dll

/r:System.Workflow.ComponentModel.dll

/r:System.Workflow.Runtime.dll

/r:System.Runtime.Serialization.dll

/r:System.ServiceModel.dll

/r:System.Core.dll

/r:System.Xml.Linq.dll

/r:System.Data.Linq.dll

/r:System.Data.DataSetExtensions.dll

/r:System.Web.Extensions.dll

/r:System.Web.Extensions.Design.dll

/r:System.ServiceModel.Web.dll

# Import System and Microsoft.VisualBasic

/imports:System

/imports:Microsoft.VisualBasic

/imports:System.Linq

/imports:System.Xml.Linq

/optioninfer+

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