473,386 Members | 1,775 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Can't figure out the error

IAny idea what this error is?

C:\Documents and Settings\dfetrow\My Documents\Visual Studio
Projects\FTPTimer\Service1.cs(15): The type or namespace name 'TimedItem'
could not be found (are you missing a using directive or an assembly
reference?)
namespace CodeGuru.TimerService

{

public class TimerService : System.ServiceProcess.ServiceBase

{

private System.Diagnostics.EventLog _AppEventLog;

private Thread[] _WorkerThreads;

private TimedItem[] _Timers; ********************************Error
--
David
Nov 16 '05 #1
5 2348
It means just what it says, you're missing it's
namespace and/or it's assembly reference.
You need to ask yourself:
Where is TimedItem defined? Is it's assembly
added in the list of References? What is it's namespace?

RayO

"DaveF" <df*****@geodecisions.com> wrote in message
news:uY*************@tk2msftngp13.phx.gbl...
IAny idea what this error is?

C:\Documents and Settings\dfetrow\My Documents\Visual Studio
Projects\FTPTimer\Service1.cs(15): The type or namespace name 'TimedItem'
could not be found (are you missing a using directive or an assembly
reference?)
namespace CodeGuru.TimerService

{

public class TimerService : System.ServiceProcess.ServiceBase

{

private System.Diagnostics.EventLog _AppEventLog;

private Thread[] _WorkerThreads;

private TimedItem[] _Timers; ********************************Error
--
David

Nov 16 '05 #2
Hi David,

That is one of the most common errors you will encounter.
When the compiler encounters TimeItem[] it cannot find any description of the object in the current namespace or in any "using" namespaces.

As TimedItem isn't defined anywhere in the code, figure out where it is defined and add a using to that namespace as well as a reference to that assembly.

Beware, it may also be caused by simple typos where for instance TimeItem is defined but TimedItem is not. Check your spelling as well.

--
Happy Coding!
Morten Wennevik [C# MVP]
Nov 16 '05 #3
I am new to C#
I am trying the following code:

http://www.developer.com/net/net/art...1087_3335731_1
--
David
http://www.helixpoint.com


"Morten Wennevik" <Mo************@hotmail.com> wrote in message
news:opscxd57mfklbvpo@morten-xp...
Hi David,

That is one of the most common errors you will encounter.
When the compiler encounters TimeItem[] it cannot find any description of the object in the current namespace or in any "using" namespaces.
As TimedItem isn't defined anywhere in the code, figure out where it is defined and add a using to that namespace as well as a reference to that
assembly.
Beware, it may also be caused by simple typos where for instance TimeItem is defined but TimedItem is not. Check your spelling as well.
--
Happy Coding!
Morten Wennevik [C# MVP]

Nov 16 '05 #4
Hi David,

A bit down on that page you will notice

public class TimedItem

This is where TimedItem is described and it is defined under the CodeGuru.TimerService namespace, same as the rest of the code.

Either put both classes in the same file and in the same namespace {} or if you put them in separate files, make sure you add the TimedItem file when compiling.

ie

csc TimerSample.cs TimedItem.cs TimerService.cs

As long as the files use the same namespace you don't need to add a "using", but if they weren't you would need to add

using CodeGuru.TimerService;

so the compiler will check that namespace for the TimedItem definition.

--
Happy Coding!
Morten Wennevik [C# MVP]
Nov 16 '05 #5
Hi Dave,
It means that you mispelled a variable name or that you forgot to include a
namespace.

The compiler will give you different errors when you make reference to a
nonexisten variable:

if you do

mispelledVariable = 4;

will result in a msg like "mispelledVariable does not exist in ..."

but if you do this

mispelledVariable.value = 4;

will gives you the error you are seeing.
Hope this help

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"DaveF" <df*****@geodecisions.com> wrote in message
news:uY*************@tk2msftngp13.phx.gbl...
IAny idea what this error is?

C:\Documents and Settings\dfetrow\My Documents\Visual Studio
Projects\FTPTimer\Service1.cs(15): The type or namespace name 'TimedItem'
could not be found (are you missing a using directive or an assembly
reference?)
namespace CodeGuru.TimerService

{

public class TimerService : System.ServiceProcess.ServiceBase

{

private System.Diagnostics.EventLog _AppEventLog;

private Thread[] _WorkerThreads;

private TimedItem[] _Timers; ********************************Error
--
David

Nov 16 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Aaron Walker | last post by:
Greetings, I'm attempting to write my first *real* template function that also deals with a map of strings to member function pointers that is making the syntax a little tricky to get right. ...
6
by: Frankie Montenegro | last post by:
Hi everyone, I need some help with the following C++ code. It is supposed to read input line by line, each line as one string; then split each string into its component words and store these...
10
by: MHenry | last post by:
Hi, We were going merrily along for 6 years using this database to record all client checks that came into our office, including information about what the checks were for. Suddenly, network...
102
by: Skybuck Flying | last post by:
Sometime ago on the comp.lang.c, I saw a teacher's post asking why C compilers produce so many error messages as soon as a closing bracket is missing. The response was simply because the compiler...
0
by: William Stacey [MVP] | last post by:
This code worked on fx 1.1 and now I get a "Keyset does not exist" error when trying to SignData with RSA under FX2.0. Smells like some security error, but can't debug it as I think error is...
3
by: Brian Blais | last post by:
Hello, I have an odd kind of Heisenbug in what looks like a pretty simple program. The program is a progress bar code I got at the Python Cookbook: ...
2
by: kkleung89 | last post by:
Basically, here's what's happening with the program. I have a table of Customers and a table of Pets, with the latter containing a field linking it to its customer of ownership. I have a form...
9
by: Tony Girgenti | last post by:
Hello. I'm developing and testing a web application using VS.NET 2003, VB, .NET Framework 1.1.4322, ASP.NET 1.1.4322 and IIS5.1 on a WIN XP Pro, SP2 computer. I'm using a web form. For a...
2
by: ayman723 | last post by:
hi; I have this code in my book and when I copied it into my compiler into two files, one is header and the other is .cpp. it gives me an error, I'm sure I copied it right but can't figure out the...
4
by: Protoman | last post by:
Can you please help me figure out what the error is here, in this rotor cipher simulator, which I wrote to amuse myself? The runtime error is that it isn't symmetrical --decrypting a piece of...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.