|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
How do I compile an Instantiable class + the startup class that calls it in Visual st
Hi :-)
I`m stuck, the book im learning from teaches everything from use via the command promt not visual studio, the chapter ive just started is about instantiable classes so in visual studio I am unable to compile either the instantiable class nor the startup class. With the startup its "Error type or namespace XXX could not be found (are you missing... " ect and in the instantiable class the error is thaqt it doesnt contain an entry point (Main() lol) which would be fine if it still compiled but no .exe is created..... Ive looked through Help with no luck and search in help crashs me (even a reinstall doesnt fix that :-/) I have attempted a right-click add referance on the right but the file types its looking for are file types that do not exist in my instantiable classes solutuion folder :-/ (cept for debug) can anyone help out? Basicaly, I have written a lil method I wanna just call (instantiate into an object if I have to, but would much rather just have a "using" that class at the top and just call the method when I want it, just as calling WriteLine("blah") )when I want to use it, which is often. Can anyone help? Cheers ![]() |
|
#2
|
|||
|
|||
|
could you post your code? and please use the CODE TAGS.
|
|
#3
|
|||
|
|||
|
Quote:
Sure no problem ![]() Here is the instantiable class. This file is named "Banner" too of course ![]() Code:
using System;
public class Banner
{
public string codingLanguage;
public void Display()
{
Console.WriteLine("I'm using " + codingLanguage);
}
}
and here's the startup class Code:
public class Example7_1
{
public static void Main(string[] args)
{
Banner x = new Banner();
x.codingLanguage = "C#";
x.Display();
}
}
|
|
#4
|
|||
|
|||
|
what line of code are you getting the error message at? and what namespace is it saying that you are missing?
|
|
#5
|
|||
|
|||
|
It's cool, the problem is now fixed with a responce on another board
![]() "Pulldown menu "Project" add class" hehe :-) |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > .Net Development > How do I compile an Instantiable class + the startup class that calls it in Visual st |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|