Jestem początkującym w C# i próbuję uruchomić przykładowy program C# z samouczka.Punkt nie istnieje w przestrzeni nazw System.Drawing
Kiedy próbuję uruchomić poniższy kod pojawia się następujący błąd:
Error 1 The type or namespace name 'Point' does not exist in the namespace 'System.Drawing' (are you missing an assembly reference?) C:\Users\Documents\Visual Studio 2012\Projects\HelloWorld\HelloWorld\Class1.cs 20 28 HelloWorld
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;
namespace HelloWorld
{
class Hello
{
static void Main()
{
Nullable<bool> b = false;
if (b.HasValue) Console.WriteLine("b is {0}", b.Value);
else Console.WriteLine("b is not set");
System.Drawing.Point p = new System.Drawing.Point(20, 30);
Console.WriteLine(b);
Console.WriteLine("Hello World");
Console.WriteLine("Press any key to exit");
Console.ReadKey();
}
}
}
Czy Twój projekt odwołuje się do pliku 'System.Drawing.dll'? Jest to zasadniczo * dokładnie * o czym jest komunikat o błędzie. –
Jak dodać odniesienie do pliku System.Drawing.dll? Czy muszę pobrać bibliotekę DLL lub jak zlokalizować ją w moim komputerze i skierować ją do kompilatora? – user1050619
W swoim VS, pokaż Solution Explorer-> kliknij prawym przyciskiem myszy Referencje-> Dodaj referencje -> .NET-> cokolwiek co –