Type Stopwatch could not be found

c#, xamarin-studio

Solution

Although you say that you've included the `using` directive, the error message begs to differ.

Ensure that this line is in the same `.cs` file as your method, at the very top:

using System.Diagnostics;

In Visual Studio, you can see this by clicking the icon underneath the error:

Maybe there's a similar feature in Xamarin Studio.

Problem

I'm learning C# using Xamarin Studio 4.0.3 (former MonoDevelop) on Windows 7. Trying using `Stopwatch` class (only piece of code) ``` using System.Diagnostics; class MainClass { public static void Main (string[] args) { Stopwatch stopWatch = new Stopwatch(); } } ``` I get: Error CS0246: The type or namespace name `Stopwatch' could not be found. Are you missing a using directive or an assembly reference? My target framework is: Mono .NET 4.0. According to MSDN Stopwatch Class should be implemented. BTW, `DateTime` class works fine. Question is: am I missing something (right namespace, library linking) or Stopwatch simply isn't implemented?

Original source