Ooui icon indicating copy to clipboard operation
Ooui copied to clipboard

Cannot find System.Drawing.Color

Open aesalazar opened this issue 6 years ago • 1 comments

Hi guys. I was trying to diagnose a problem I am having with a project I am working on and have narrowed it down to System.Drawing.Color. It can easily be reproduced it turns out using the Web DOM Wasm wiki project project:

https://github.com/praeclarum/Ooui/wiki/Web-DOM-with-Web-Assembly

I am currently running .NET Core 2.1 but I tried with 2.0 and got the same result. The guide project builds and runs fine. But the moment I add a line like `var color = System.Drawing.Color.Red' I start getting warnings that it cannot find the type and the project stops working:

Microsoft (R) Build Engine version 15.8.166+gd4e8d81a88 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restore completed in 72.66 ms for C:\Users\ernie\OneDrive\CodeTests\MyApp\MyApp.csproj.
C:\Users\ernie\.nuget\packages\ooui.wasm\0.10.222\build\netstandard2.0\Ooui.Wasm.targets(17,3): warning : Failed to resolve type System.Drawing.Color [C:\Users\ernie\OneDrive\CodeTests\MyApp\MyApp.csproj]
C:\Users\ernie\.nuget\packages\ooui.wasm\0.10.222\build\netstandard2.0\Ooui.Wasm.targets(17,3): warning : Failed to resolve method System.Drawing.Color System.Drawing.Color::get_Red() [C:\Users\ernie\OneDrive\CodeTests\MyApp\MyApp.csproj]
C:\Users\ernie\.nuget\packages\ooui.wasm\0.10.222\build\netstandard2.0\Ooui.Wasm.targets(17,3): warning : Failed to resolve type System.Drawing.Color [C:\Users\ernie\OneDrive\CodeTests\MyApp\MyApp.csproj]
  MyApp -> C:\Users\ernie\OneDrive\CodeTests\MyApp\bin\Debug\netcoreapp2.1\MyApp.dll

Build succeeded.

C:\Users\ernie\.nuget\packages\ooui.wasm\0.10.222\build\netstandard2.0\Ooui.Wasm.targets(17,3): warning : Failed to resolve type System.Drawing.Color [C:\Users\ernie\OneDrive\CodeTests\MyApp\MyApp.csproj]
C:\Users\ernie\.nuget\packages\ooui.wasm\0.10.222\build\netstandard2.0\Ooui.Wasm.targets(17,3): warning : Failed to resolve method System.Drawing.Color System.Drawing.Color::get_Red() [C:\Users\ernie\OneDrive\CodeTests\MyApp\MyApp.csproj]
C:\Users\ernie\.nuget\packages\ooui.wasm\0.10.222\build\netstandard2.0\Ooui.Wasm.targets(17,3): warning : Failed to resolve type System.Drawing.Color [C:\Users\ernie\OneDrive\CodeTests\MyApp\MyApp.csproj]
	3 Warning(s)
	0 Error(s)

Time Elapsed 00:00:03.15

Here is the code:

using System;

namespace MyApp
{
	class Program
	{
		static void Main(string[] args)
		{
			var point = new System.Drawing.Point(10,20);
			Console.WriteLine(point);
			
			var color = System.Drawing.Color.Red;
			Console.WriteLine(color);

			Console.WriteLine("Hello World!");
		}
	}
}

If I comment out the two lines with the color var it works just fine and point prints to the console as expected.

Any thoughts? Thanks Ernie

aesalazar avatar Aug 27 '18 12:08 aesalazar

have you tried using eto.drawing?
eto.drawing.color

blackholeearth avatar Sep 14 '18 14:09 blackholeearth