Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialAndrew Mackrell
2,734 PointsCompiler error: error CS2015: Source file `TreehouseDefense.exe' is a binary file and not a text file
I already worked through a bunch of errors but I can't get rid of this one.
error CS2015: Source file `TreehouseDefense.exe' is a binary file and not a text file
2 Answers
Steven Parker
231,268 PointsThat file "TreehouseDefense.exe" is the output file, it's not one of the sources. So when you build the code, you want to be sure to tell the compiler that's where to put the output and not to use it as an input.
Typically, the build command would look like this:
$ mcs -out:TreehouseDefense.exe *.cs
If you still have trouble, show what you are using as the build command.
Scott George
19,060 Pointsmcs -out:TreehouseDefence.exe *.cs && mono TreehouseDefence.exe
Is still giving me this error. Hmm
Wesley Trayer
13,812 PointsWesley Trayer
13,812 PointsI got this error when I had a space between the "*" and ".cs".
Steven Parker
231,268 PointsSteven Parker
231,268 PointsThe correct command (with no extra space) means "use every file that ends in ".cs" as an input", but the command with the space means "use every file as an input, and then read the file named ".cs" again".
Wesley Trayer
13,812 PointsWesley Trayer
13,812 PointsThanks! I was wondering what difference the space made.