Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

C# C# Basics (Retired) Console I/O Formatting Output

Suraj Shah
Suraj Shah
4,326 Points

Program.cs(13,36): error CS0029:

I used the same code as in the teacher's notes but get this error when compiling. How can i fix this issue?

I entered mcs Program.cs && mono.Program.exe in the compiler

Program.cs(13,36): error CS0029: Cannot implicitly convert type int' tostring'
Compilation failed: 1 error(s), 0 warnings

Jonas Gamburg
Jonas Gamburg
11,193 Points

It would help if you'd paste here the specific code line that prompts you this error. You are basically trying to use an int in a place where it requires a string.

1 Answer

Simon McGuirk
Simon McGuirk
2,673 Points

Looks like a typo in the command you're submitting. The first half is correct but the second half you're typing mono.Program.exe This should actually be mono Program.exe.

So try mcs Program.cs && mono Program.exe and that should hopefully fix the error you're seeing. If not please post your code so we can see why you're getting the Cannot implicitly convert type int' tostring' error.