Response files are similar to batch files, having some specific instruction. On execution they perform some predefined task based on instruction. Response file contains instruction to compile programs.
If we have to build complex program through command line then response files are really helpful in development process. rsp is an extension for response files. By default, csc.rsp file exists under "Framework" folder Ex: C:\Windows\Microsoft.NET\Framework\v4.0.30319. csc.rsp contains long list of system references (dlls).
Some contents under csc.rsp
# Reference the common Framework libraries
/r:Accessibility.dll
/r:Microsoft.CSharp.dll
/r:System.Configuration.dll
/r:System.Configuration.Install.dll
/r:System.Core.dll
/r:System.Data.dll
/r:System.Data.DataSetExtensions.dll
/r:System.Data.Linq.dll
..........
In same way we can have our own response file defined which might include some third party dll. Let's see an example.
Suppose we have to create an application which uses windows form and library named Sample.Test.
Texts under test.rsp file:
# External assembly references.
/r:System.Windows.Forms.dll
/r:Sample.Test
# File generation instructions
/target:exe /out:Test.exe *.cs
# symbol is used for comments. We have added two library with /r parameter. *.cs will include all files under that library.
Now for compilation we just need to execute csc @test.rsp
If we have to build complex program through command line then response files are really helpful in development process. rsp is an extension for response files. By default, csc.rsp file exists under "Framework" folder Ex: C:\Windows\Microsoft.NET\Framework\v4.0.30319. csc.rsp contains long list of system references (dlls).
Some contents under csc.rsp
# Reference the common Framework libraries
/r:Accessibility.dll
/r:Microsoft.CSharp.dll
/r:System.Configuration.dll
/r:System.Configuration.Install.dll
/r:System.Core.dll
/r:System.Data.dll
/r:System.Data.DataSetExtensions.dll
/r:System.Data.Linq.dll
..........
In same way we can have our own response file defined which might include some third party dll. Let's see an example.
Suppose we have to create an application which uses windows form and library named Sample.Test.
Texts under test.rsp file:
# External assembly references.
/r:System.Windows.Forms.dll
/r:Sample.Test
# File generation instructions
/target:exe /out:Test.exe *.cs
# symbol is used for comments. We have added two library with /r parameter. *.cs will include all files under that library.
Now for compilation we just need to execute csc @test.rsp
Comments
Post a Comment