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




























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….

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

Leave a Reply

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

You are commenting using your 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