Contact | License

# 1503 - C# compiler should use CSAssembly.

Description
CSAssembly exposes the functionality necessary to correctly compile C# code. ObjectList/Library should not be used to compile C# code.
Example
Config:
Compiler( 'CSharpCompiler' ) { .Executable = 'csc.exe' } ObjectList( 'ObjectList' ) { .Compiler = 'CSharpCompiler' // Invalid .CompilerOptions = '/out:"%2" /target:library "%1"' .CompilerInputFiles = 'src/file.cs' .CompilerOutput = 'out/output.dll' }
Output:
C:\test\fbuild.bff(6,1): FASTBuild Error #1503 - ObjectList() - C# compiler should use CSAssembly. ObjectList( 'ObjectList' ) ^ \--here
Fix:
Compiler( 'CSharpCompiler' ) { .Executable = 'csc.exe' } CSAssembly( 'CSharp' ) { .Compiler = 'CSharpCompiler' .CompilerOptions = '/out:"%2" /target:library "%1"' .CompilerInputFiles = 'src/file.cs' .CompilerOutput = 'out/output.dll' }