Hi, I am an absolute beginner in C# and I use Visual C# 2010 express.
I wanted to learn from the examples, so I downloaded the yahtzee-game from this site.
Unrarred the yahtzee-file onto my harddisk and tried to open the project from within Visual C# 2010 express. Then a conversion Wizzard start and converts the program into Visual C# 2010. It said it was converted succesfully.
Next I tried to build and run the game, but I got lots of errors ( see screenshot from the uploaded file ).
What did I do wrong?
Loading
Sam HobbsPosted Nov 7, 2010, 7:22 PM
syncanPosted Nov 7, 2010, 5:13 PM
Sam HobbsPosted Nov 7, 2010, 2:44 PM
Deleting the using statements and the references might not help solve the problem but it helps to do the clean-up at least.
In that sample, there is a using statement for Forms but the program uses the namespace name in the code. It might work to simply remove the namespace name in the code and just fix the using statement. Regardless, I got to a pointg where I was not sure what to do so I decided not to do it myself. I hope we hear from Mike.
I have looked at your original question and looked a third time. I don't see a link to anything anywhere in the message. So I assume you misunderstand what I meant.
If you meant that you put the link in the subject, then please look again; it is not there. Also for the future, it helps to always put everything from the subject in the body; don't put relevant information in the subject and assume we will see it
syncanPosted Nov 7, 2010, 9:49 AM
I just send him a message with the question to convert it.
Mahesh ChandPosted Nov 7, 2010, 9:10 AM
syncanPosted Nov 7, 2010, 6:32 AM
Ik was indeed the first Yahtzee-article, but I DID place a link in my previous post, just watch the last sentence overthere.
Never thought of removing/replacing using-statements. Good one :-)
Sam HobbsPosted Nov 6, 2010, 10:02 PM
There are many other fixes that are needed to make the source code compatible with the current version of .Net, so I suggest that you look for other articles and samples for now until the Yahtzee article is revised or you have learned enough to know how to fix the problems yourself.
syncanPosted Nov 6, 2010, 12:11 PM
Microsoft.Win32.Interop
System.Diagnostics
System.Timers
System.Winforms
I am using .net version 4.0
If I do what you said about 'Add reference' and try to get System.Core I get the following error:
"A reference to system.core could not be added. The component is already be referenced by the build system"
I did not find any DLL from system.WinForms. In fact, there is no dll at all in the solution folder.
The game I am talking about is this one:
http://www.c-sharpcorner.com/UploadFile/mgold/yahtzee11142005043447AM/yahtzee.aspx
JurePosted Nov 6, 2010, 11:48 AM
-If there's no System.Core reference in that folder, right click on folder, click "Add reference", go to .NET tab and search for System.Core, click OK.
-System.WinForms isn't built-in library (at least I can't find it), so try to search for dll file in the solution's folder on your disk.