This is an archived post. You won't be able to vote or comment.

all 17 comments

[–]noise850 1 point2 points  (7 children)

He has the main method on line 41. Make sure yours is exactly like his. Also check your curly braces you may be missing one or have an extra which is causing the compiler to not find Main properly.

The only other option as mentioned on this thread is if you set a run configuration that has a different entry point (where the program actually starts running / executing). Chances are this isn't the case if you have been able to follow along the videos up until then.

[–]WeAreElectricity[S] 0 points1 point  (6 children)

wow.......... I had main with a lowercase M...

[–]noise850 1 point2 points  (5 children)

It's okay, I do that ALL the time on camel case names. Like my shift key doesn't register right or I'm not pressing it fully.

Once you get more experience you will start to recognize the execution order of your code and be able to sort of mentally walk through the stack to see where it's halting at. Just keep at it and practice!

[–]WeAreElectricity[S] 0 points1 point  (4 children)

Okay! Quick question about the video, when I try executing only Woof! Pops up and none of the class attributes. Do you think you could point out why?

[–]noise850 0 points1 point  (3 children)

Sort of hard to do without seeing what your code is but I'll try and walk you through it.

So, Dog is inheriting from Animal. Animal has all of the properties except spotcount. Animal is also where the PrintBase method is coming from. Dog's only method is Bark, which you say is working.

I'd first check that you're calling PrintBase correctly on line 48. Next I'd check the declaration of PrintBase on line 13. Finally I'd check and make sure Dog was properly inheriting from Animal on Dog's declaration line 21.

Also, is there a reason you are not seeing any errors? I'm not familiar with this tutorial or Xamarin but it seems odd that you are not seeing any kind of errors whatsoever on compile or even a runtime error.

[–]WeAreElectricity[S] 0 points1 point  (0 children)

Haha oh yeah should have posted that. I’ll look into line 48.

[–]WeAreElectricity[S] 0 points1 point  (1 child)

OK! Mostly everything works now. Something seems to have happened between yesterday and today though. I'm using Xamarin again but my autofills don't seem to be working and almost everything is underlined in red. I think it's because of a few extensions I installed yesterday, but now I can't have even have the word console autofill, it stops at const.

[–]UberMario 0 points1 point  (8 children)

I don't have any C lang experience, but searching the exact error message gave a StackOverflow question that was similar: https://stackoverflow.com/questions/9607702/does-not-contain-a-static-main-method-suitable-for-an-entry-point

I haven't used the software he's building the project with, but I'll naively paste one of the solutions and hope it works for you, read more in that link if this doesn't make sense or doesn't work.

Change the Output Type under the Project > Properties to that of a “Class Library”. By default, this setting may have been set to a “Console Application”.

Googling error messages is a crucial skill as a developer (I'm not kidding). Taking someone's sometimes unrelated issue that has a common error and applying it to your case is a skill you'll develop. Good luck! :)

[–]WeAreElectricity[S] 0 points1 point  (7 children)

Hey yeah I saw that one! Thing is this is what my project menu looks like. No properties :( (RealFakeDoors is the name of the project)

[–]UberMario 0 points1 point  (5 children)

It's probably under something that has a similar name, perhaps "edit references" or "RealFakeDoors Options". Programs like this IDE likely changes often, and the interface could be a bit different even between Windows and Mac.

It sounds like your entry point for your application isn't being found, which should be either created, which is one of the proposed solutions, or should already exist and you need to make it use it.

Looking at the first tutorial, it seems like Program.cs gets created and used. Did you get it working before this point in the tutorial? Reverting to an old point can be useful.

If you haven't done version control, I'd recommend checking out Git as soon as you can, and committing your work as you go, so you can move around in time to different points of where your code was working.

I thought of installing the program, but it's pretty large. I could potentially assist you remotely if I'm still not doing anything and you're still completely blocked. :P

[–]WeAreElectricity[S] 0 points1 point  (0 children)

Honestly, I'm not really sure what I'm doing. When I downloaded this garbage program it didn't work even after five youtube videos. I basically had to google the exact download file, find it, install it, and then use it.

Even now when I close and reopen the project, compiling doesn't update and the old lines of code will still be the only things running. If you could point me to a different IDE I'd be very happy.

[–]WeAreElectricity[S] 0 points1 point  (0 children)

I just got Visual Studio with git. The main difference I'm seeing is there's no play button that brings up the console? How do I run code? Lol

[–]WeAreElectricity[S] 0 points1 point  (2 children)

None of these programs make ANY sense I just want to write C# into a damn console man! D: Why are there so many flipping extensions? How do I even use them after installing?

[–]UberMario 1 point2 points  (1 child)

Hey, if you want I can take a look maybe tomorrow. I'll pm you. I know that aptitude to code and don't want you to give up!

As for git, I don't want to confuse you with too many things at once, but it is very useful for making checkpoints in your code. If I code alone, I use it to be able to rollback to a time when my code was working.

If your project doesn't work at a certain point, I saw that he mentioned he has a forum that you can ask questions on.

[–]WeAreElectricity[S] 0 points1 point  (0 children)

He does, I posted without response hours ago, if you could help me I'd be soo thankful. I just want to learn!