Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

C# Problem - Cant find type or namespace


  • Please log in to reply

#1
Jack Wetson

Jack Wetson

    Member

  • Member
  • PipPip
  • 10 posts
Im fairly new to c#, but this code is copied and should work, what am i doing wrong?? Any help is greatly appreciated. See attached img for details.

Many Thanks

Attached Thumbnails

  • Error.jpg

  • 0

Advertisements


#2
W-Unit

W-Unit

    Member

  • Member
  • PipPipPip
  • 170 posts
This problem occurs when you have tried to declare or instantiate a variable of a type which the compiler does not recognize.
By looking at the right pane in Visual C#, it looks like you MAY be able to solve this problem by simply adding the following line at the very top of the file:
using Lib;
If this doesn't work, open the files "Lib_Unit.cs," "Lib_POS.cs," etc, and look near the top to see what follows the word namespace. Add this as a using directive at the top of your script file and that should solve it. If those files use more than one namespace, be sure to add using directives for all of them.

For example, if the files Lib_Unit.cs, Lib_POS.cs, etc, all looked something like this at the top:
using System;
using System.Text;
using System.Collections.Generic;

namespace Foo
{
...
Then you would add this at the top of the script file you had open on the screenshot there:
using Foo;

Hope this helps!
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP