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 trialwgrywgrywgryg
854 Pointsnull
null
5 Answers
Jon Wood
9,884 PointsLooks like you have a ;
at the end of the Main
method - public static void Main();
. Just remove that and that error will go away.
Also, I noticed that the Console.ReadLine
doesn't have parentheses. That's going to cause a compile error as well. Just add them on and it should all work. :)
wgrywgrywgryg
854 Pointsit still did not work.... is there something wrong with workspaces?
Jon Wood
9,884 PointsThat's weird. It worked when I tried it. Are you running mcs Calculator.cs
to compile?
wgrywgrywgryg
854 Pointswhat do you mean? i type this in the console to run it: clear && mcs Program.cs && mono Program.exe
wgrywgrywgryg
854 Pointsoh ok, I ran it wth MCS Calculator.cs and it compiled. how does that work? why didn't clear && MCS Program.cs && mono Program.exe work? can you explain this to me? I'm new to coding but THANK YOU SO MUCH!! YOU ARE SO HELPFUL!!!!!
wgrywgrywgryg
854 Pointsalso in the code that you made to help me, I did not understand the int.parse can you explain what that means?
Jon Wood
9,884 PointsSure! The Main
method was in the Calculator.cs
file so that's the file that needed to be compiled. If you wanted to you could move the code to the Program.cs
file.
The int.Parse
method takes in a string and attempts to parse it into an integer.
wgrywgrywgryg
854 Pointswgrywgrywgryg
854 Pointsit didnt compile. is it a bug with workspaces?
Jon Wood
9,884 PointsJon Wood
9,884 PointsI forked your workspace and made some changes - https://w.trhou.se/53c08cubbp
Try to compare that between yours and see if you can get yours to work. Let me know if you still can't get it. :)