Windows Develop Bookmark and Share   
 index > Windows Forms Sample Applications > Sample code not working in VB.NET ???
 

Sample code not working in VB.NET ???

Tried to use this sample with the V1.0 Framework and 1.0.25.281 of Terrarium.

http://www.windowsforms.net/Terrarium/docs/QuickStart/VBHerbivore.aspx

Get the following error.
"You must Define 'OrganismClassAttribute" attribute on your assembly".


Thanks in Advance
Dontec.
MigrationUser 1  Friday, May 30, 2003 11:46 PM
Interesting.  I'm not a VB programmer, so I'll answer in C#, forgive me.  At the top of the file, you have some comments stating certain attributes are needed, but the attributes are missing.  I've filled them in below (replace author information with your info):

' The following Assembly attributes must be applied to each Organism Assembly
' The class that derives from Animal
[assembly: OrganismClass("VBCreatures.SimpleHerbivore")]

' Provide Author Information
' Author Name, Email
[assembly: AuthorInformation("David Kocur", "dkocur@airmail.net")]
MigrationUser 1  Saturday, May 31, 2003 8:30 AM
Oh, that.
For some reason when MS transfered the sample code from GOTDOTNET they left out two lines at the top:

<Assembly: OrganismClass("VBCreatures.SampleHerbivore1")> 
<Assembly: AuthorInformation("Your Name", "Your Email")> 

This snippet should go right above "Namespace VBCreatures".
If you named you creature class something different, change VBCreatures.SampleHerbivore to (Namespace).(CreatureClass). Good luck!
MigrationUser 1  Saturday, May 31, 2003 11:34 AM
Also, something I forgot. Any creature will NOT work with .NET Terarrium version 1.0.25.
Get the old working version (v. 1.0.21) at http://s2kmail.nm.ru/terrarium17.msi. Have fun!
MigrationUser 1  Saturday, May 31, 2003 11:37 AM
Also - something buried in the FAQ is the VB.NET automatically adds a default namespace to the class.  To remove the default namespace, right click on the class, and go to properties.  Remove the default namespace.  Once thats done then the assembly organismclass attribute will work.  Make sense?  (if not - have a look in the FAQ ; P
MigrationUser 1  Monday, June 02, 2003 2:07 AM

You can use google to search for other answers

Custom Search

More Threads

• HELP!!! --> setting up terrarium server
• Using rich text box for Text Editor
• Custom Skins
• Receiving Cretaures
• DCOM Server Process Launcher SP3 5512
• Who's still using Terrarium?
• ProgressBar Thread
• Unrealistic animal birth
• Where to get old version of Terrarium client
• C# help