Response files in C#


When you write any .NET application it will always add some of the assemblies by default. How will this happen? When I think about the probable answer I thought it might be GAC. But when I googled it I found the answer is completely different. The answer is a response file.

 What is a response file (.rsp) file:  A response file is a text file that tells the compiler what are the command line switches to be added. When you execute CSC.exe, the compiler opens response files and uses any switches that are specified in them as though the switches were passed to CSC.exe on the command line.

When you install the .NET Framework, it installs a default global CSC.rsp file in the %System-Root%\Microsoft.NET\Framework\vX.X.X directory (where X.X.X is the version of the .NETFramework you have installed). The 2.0 version of this file contains the following switches: 

# This file contains command-line options that the c#

# command line compiler (CSC) 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.Data.SqlXml.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

You can add more dlls to the above file if you want. But it is not advisable as it requires to update the same file in each build machine of your respective build environment.

I hope this article helps you….

Advertisements
This entry was posted in C#. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s