Wednesday, January 29, 2014

Default parameter specifiers are not permitted

This error started appearing in our Cruise Control .NET build. However, we were not getting any errors from Visual Studio in the development environment. We are targeting .NET 3.5, and it turned out some methods were using optional parameters, which do not exist in .NET 3.5. However, Visual Studio is smart enough to be able to compile the code, but csc.exe (which is used by CC.NET) is not. We had to remove the optional parameters and to make sure it didn't happen again, we set the Language Version to C# 3.0 in Project Properties -> Build -> Advanced -> Language Version. Check out this post for more detailed information