{"action":"created","issue":{"url":"https://api.github.com/repos/vvvv/SVG/issues/581","repository_url":"https://api.github.com/repos/vvvv/SVG","labels_url":"https://api.github.com/repos/vvvv/SVG/issues/581/labels{/name}","comments_url":"https://api.github.com/repos/vvvv/SVG/issues/581/comments","events_url":"https://api.github.com/repos/vvvv/SVG/issues/581/events","html_url":"https://github.com/vvvv/SVG/issues/581","id":496267708,"node_id":"MDU6SXNzdWU0OTYyNjc3MDg=","number":581,"title":"Netstandard 2.0  - SvgDocument.GetXML()","user":{"login":"HughGrovesArup","id":40033911,"node_id":"MDQ6VXNlcjQwMDMzOTEx","avatar_url":"https://avatars3.githubusercontent.com/u/40033911?v=4","gravatar_id":"","url":"https://api.github.com/users/HughGrovesArup","html_url":"https://github.com/HughGrovesArup","followers_url":"https://api.github.com/users/HughGrovesArup/followers","following_url":"https://api.github.com/users/HughGrovesArup/following{/other_user}","gists_url":"https://api.github.com/users/HughGrovesArup/gists{/gist_id}","starred_url":"https://api.github.com/users/HughGrovesArup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HughGrovesArup/subscriptions","organizations_url":"https://api.github.com/users/HughGrovesArup/orgs","repos_url":"https://api.github.com/users/HughGrovesArup/repos","events_url":"https://api.github.com/users/HughGrovesArup/events{/privacy}","received_events_url":"https://api.github.com/users/HughGrovesArup/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2019-09-20T10:11:31Z","updated_at":"2019-09-20T19:15:28Z","closed_at":null,"author_association":"NONE","body":"I'm having trouble getting netstandard2.0 to work which was added in #509 \r\n\r\nThe build command I am using (from the source directory) is:\r\n\r\n```\r\ndotnet build -c release -f netstandard2.0 Svg.csproj\r\n```\r\n\r\nI get the warning\r\n\r\n```\r\nwarning NU1701: Package 'Fizzler 1.1.0' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.2'. This package may not be fully compatible with your project.\r\n```\r\n\r\nI noted that netstandard is only supported from v1.2 (rather than the v1.1 referenced on main). I blindly changed the version in the .csproj file and tried again (required removing the other compilation targets). This then build successfully.\r\n\r\nI refernced this into my project and all seems well until I get to SvgDocument.GetXML() which throws the exception:\r\n\r\n```\r\n{System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'Svg.SvgElement' threw an exception. ---> System.PlatformNotSupportedException: System.Drawing is not supported on this platform.\r\n   at System.Drawing.Text.PrivateFontCollection..ctor()\r\n   at Svg.SvgElement..cctor() in C:\\Users\\Hugh.Groves\\Documents\\VS_Code_Projects\\SVG-1\\source\\SvgElementStyle.cs:line 420\r\n   --- End of inner exception stack trace ---\r\n   --- End of inner exception stack trace ---\r\n   at System.RuntimeFieldHandle.GetValue(RtFieldInfo field, Object instance, RuntimeType fieldType, RuntimeType declaringType, Boolean& domainInitialized)\r\n   at System.Reflection.RtFieldInfo.UnsafeGetValue(Object obj)\r\n   at System.Reflection.RtFieldInfo.GetValue(Object obj)\r\n   at Svg.SvgElement.WriteAttributes(XmlTextWriter writer) in C:\\Users\\Hugh.Groves\\Documents\\VS_Code_Projects\\SVG-1\\source\\SvgElement.cs:line 601\r\n   at Svg.SvgFragment.WriteStartElement(XmlTextWriter writer) in C:\\Users\\Hugh.Groves\\Documents\\VS_Code_Projects\\SVG-1\\source\\Document Structure\\SvgFragment.cs:line 308\r\n   at Svg.SvgElement.Write(XmlTextWriter writer) in C:\\Users\\Hugh.Groves\\Documents\\VS_Code_Projects\\SVG-1\\source\\SvgElement.cs:line 788\r\n   at Svg.SvgDocument.Write(XmlTextWriter writer) in C:\\Users\\Hugh.Groves\\Documents\\VS_Code_Projects\\SVG-1\\source\\SvgDocument.cs:line 704\r\n   at Svg.SvgDocument.Write(Stream stream, Boolean useBom) in C:\\Users\\Hugh.Groves\\Documents\\VS_Code_Projects\\SVG-1\\source\\SvgDocument.cs:line 729\r\n   at Svg.SvgExtentions.GetXML(SvgDocument doc) in C:\\Users\\Hugh.Groves\\Documents\\VS_Code_Projects\\SVG-1\\source\\SvgExtentions.cs:line 38\r\n   at DesignCheck2.Examples.DynamicImage.CreateImage(Double width, Double height) in c:\\Users\\Hugh.Groves\\Documents\\designcheck2\\DesignCheck2\\DesignCheck2\\Examples\\DynamicImage.cs:line 76\r\n   at DesignCheck2.Examples.DynamicImage.<>c__DisplayClass0_0.<.ctor>b__0() in c:\\Users\\Hugh.Groves\\Documents\\designcheck2\\DesignCheck2\\DesignCheck2\\Examples\\DynamicImage.cs:line 35\r\n   at DesignCheck2.Framework.ReportSvgGraphic_Delayed.get_SVG() in c:\\Users\\Hugh.Groves\\Documents\\designcheck2\\DesignCheck2\\DesignCheck2\\Framework\\Report.cs:line 424}\r\n```\r\n\r\nIn my project I have referenced svg.dll and system.drawing.common.dll, what else am I doing wrong!\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/vvvv/SVG/issues/comments/533677647","html_url":"https://github.com/vvvv/SVG/issues/581#issuecomment-533677647","issue_url":"https://api.github.com/repos/vvvv/SVG/issues/581","id":533677647,"node_id":"MDEyOklzc3VlQ29tbWVudDUzMzY3NzY0Nw==","user":{"login":"wieslawsoltes","id":2297442,"node_id":"MDQ6VXNlcjIyOTc0NDI=","avatar_url":"https://avatars0.githubusercontent.com/u/2297442?v=4","gravatar_id":"","url":"https://api.github.com/users/wieslawsoltes","html_url":"https://github.com/wieslawsoltes","followers_url":"https://api.github.com/users/wieslawsoltes/followers","following_url":"https://api.github.com/users/wieslawsoltes/following{/other_user}","gists_url":"https://api.github.com/users/wieslawsoltes/gists{/gist_id}","starred_url":"https://api.github.com/users/wieslawsoltes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wieslawsoltes/subscriptions","organizations_url":"https://api.github.com/users/wieslawsoltes/orgs","repos_url":"https://api.github.com/users/wieslawsoltes/repos","events_url":"https://api.github.com/users/wieslawsoltes/events{/privacy}","received_events_url":"https://api.github.com/users/wieslawsoltes/received_events","type":"User","site_admin":false},"created_at":"2019-09-20T19:15:28Z","updated_at":"2019-09-20T19:15:28Z","author_association":"CONTRIBUTOR","body":"Maybe its this issue: https://stackoverflow.com/questions/51904125/azure-function-gives-error-system-drawing-is-not-supported-on-this-platform\r\n\r\nDid you try running using different target framework like `net461` ?"}}
{"actor":{"display_login":"wieslawsoltes"}}