In the book "Programming C# 4.0", the type Point is declared in System.Windows, but the Visual Studio Express 2010 compiler consider it to be an error.
The code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
class Firefighter
{
public string Name { get; set; }
public void ExtinguishFire()
{
Console.WriteLine("{0} is putting out the fire!", Name);
}
public void Drive(Firetruck truckToDrive, Point coordinates)
{
if (truckToDrive.Driver != this)
{
return;
}
truckToDrive.Drive(coordinates);
}
This is the message
Error 1 The type or namespace name 'Windows' does not exist in the namespace 'System' (are you missing an assembly reference?)
Error 2 The type or namespace name 'Point' could not be found (are you missing a using directive or an assembly reference?)
The code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
class Firefighter
{
public string Name { get; set; }
public void ExtinguishFire()
{
Console.WriteLine("{0} is putting out the fire!", Name);
}
public void Drive(Firetruck truckToDrive, Point coordinates)
{
if (truckToDrive.Driver != this)
{
return;
}
truckToDrive.Drive(coordinates);
}
This is the message
Error 1 The type or namespace name 'Windows' does not exist in the namespace 'System' (are you missing an assembly reference?)
Error 2 The type or namespace name 'Point' could not be found (are you missing a using directive or an assembly reference?)