Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
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