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 trial

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.