MigraDoc and .NET Core 2.0 The Next CEO of Stack OverflowI am using .net core with C# on linux, lib System.Drawing is missingWhat is “.NET Core”?Newtonsoft.JSON v9.01 + FileNotFoundException (.NET Core Class library)Using R.NET.Community in .NET Core 2.0 Preview 1Type 'Object' is defined in an assembly that is not referenced (NET Standard 2.0/.NET Framework 4.6.1)Use .net core with legacy .net framework dllsFileNotFoundException for a .net core class library while referenced in a .net core console appCefSharp offscreen with .net core 2.0 Runtime Error , System.IO.FileNotFoundException: 'Could not load file or assembly 'CefSharp.Core,.NET Standard 2.0 library referenced by .NET 4.6.1 project - Wrong version of Drawing library referenced.NET Core 2.2 Assembly System.Windows.Forms missingHow to determine specific dll for 'using namespace' statement in C# dotnet core

Rotate a column

Sending manuscript to multiple publishers

Is "for causing autism in X" grammatical?

Won the lottery - how do I keep the money?

Why does the UK parliament need a vote on the political declaration?

What does "Its cash flow is deeply negative" mean?

How to start emacs in "nothing" mode (`fundamental-mode`)

Can you replace a racial trait cantrip when leveling up?

Does it take more energy to get to Venus or to Mars?

Which kind of appliances can one connect to electric sockets located in a airplane's toilet?

I believe this to be a fraud - hired, then asked to cash check and send cash as Bitcoin

How do I go from 300 unfinished/half written blog posts, to published posts?

Return the Closest Prime Number

Why am I allowed to create multiple unique pointers from a single object?

Why do professional authors make "consistency" mistakes? And how to avoid them?

Why don't programming languages automatically manage the synchronous/asynchronous problem?

How do I transpose the 1st and -1th levels of an arbitrarily nested array?

Why do remote companies require working in the US?

In excess I'm lethal

Why does standard notation not preserve intervals (visually)

Is it ever safe to open a suspicious html file (e.g. email attachment)?

Is there an analogue of projective spaces for proper schemes?

MessageLevel in QGIS3

How do I avoid eval and parse?



MigraDoc and .NET Core 2.0



The Next CEO of Stack OverflowI am using .net core with C# on linux, lib System.Drawing is missingWhat is “.NET Core”?Newtonsoft.JSON v9.01 + FileNotFoundException (.NET Core Class library)Using R.NET.Community in .NET Core 2.0 Preview 1Type 'Object' is defined in an assembly that is not referenced (NET Standard 2.0/.NET Framework 4.6.1)Use .net core with legacy .net framework dllsFileNotFoundException for a .net core class library while referenced in a .net core console appCefSharp offscreen with .net core 2.0 Runtime Error , System.IO.FileNotFoundException: 'Could not load file or assembly 'CefSharp.Core,.NET Standard 2.0 library referenced by .NET 4.6.1 project - Wrong version of Drawing library referenced.NET Core 2.2 Assembly System.Windows.Forms missingHow to determine specific dll for 'using namespace' statement in C# dotnet core










1















I have made a class library for PDF-generation. It is implemented using PDFshart-MigraDoc (the core package*). The class library itself is made with .NET Standard as its target framework.



I can use the class library in classic C# projects (like WinForms), but if I try to use it with .NET Core 2.0, I get the following error:




Could not load file or assembly 'System.Drawing.Common,
Version=0.0.0.0, Culture=neutral, PublicKeyToken=xxxx'. The system
cannot find the file specified.




I guess the reason for this, could be that MigraDoc is using 'System.Drawing' in its implementation, which is (as far as I know) not supported by the .NET Core framework.



However, that doesn't really solve my problem, which is that I need the class library to work for all .NET frameworks. I have tried to include the NuGet package CoreCompat.System.Drawing, based on advise from this post. But this has been without effect, probably because MigraDoc is still trying to use the "original" System.Drawing library.



Is there any way, in which I can get my class library to work for .NET Core? Or am I out of luck...?



Note: The MigraDoc Core Package has nothing to do with the .NET Core Framework. The clash of names is merely a coincidence.










share|improve this question
























  • Do you target Windows only or other platforms also?

    – Vive la déraison
    Jul 4 '18 at 11:50











  • Currently the only target is Windows, yes. It was originally made for a WinForms project, but not a colleague of mine, also wants to use it in a .NET Core 2.0 project.

    – Noceo
    Jul 4 '18 at 12:00















1















I have made a class library for PDF-generation. It is implemented using PDFshart-MigraDoc (the core package*). The class library itself is made with .NET Standard as its target framework.



I can use the class library in classic C# projects (like WinForms), but if I try to use it with .NET Core 2.0, I get the following error:




Could not load file or assembly 'System.Drawing.Common,
Version=0.0.0.0, Culture=neutral, PublicKeyToken=xxxx'. The system
cannot find the file specified.




I guess the reason for this, could be that MigraDoc is using 'System.Drawing' in its implementation, which is (as far as I know) not supported by the .NET Core framework.



However, that doesn't really solve my problem, which is that I need the class library to work for all .NET frameworks. I have tried to include the NuGet package CoreCompat.System.Drawing, based on advise from this post. But this has been without effect, probably because MigraDoc is still trying to use the "original" System.Drawing library.



Is there any way, in which I can get my class library to work for .NET Core? Or am I out of luck...?



Note: The MigraDoc Core Package has nothing to do with the .NET Core Framework. The clash of names is merely a coincidence.










share|improve this question
























  • Do you target Windows only or other platforms also?

    – Vive la déraison
    Jul 4 '18 at 11:50











  • Currently the only target is Windows, yes. It was originally made for a WinForms project, but not a colleague of mine, also wants to use it in a .NET Core 2.0 project.

    – Noceo
    Jul 4 '18 at 12:00













1












1








1








I have made a class library for PDF-generation. It is implemented using PDFshart-MigraDoc (the core package*). The class library itself is made with .NET Standard as its target framework.



I can use the class library in classic C# projects (like WinForms), but if I try to use it with .NET Core 2.0, I get the following error:




Could not load file or assembly 'System.Drawing.Common,
Version=0.0.0.0, Culture=neutral, PublicKeyToken=xxxx'. The system
cannot find the file specified.




I guess the reason for this, could be that MigraDoc is using 'System.Drawing' in its implementation, which is (as far as I know) not supported by the .NET Core framework.



However, that doesn't really solve my problem, which is that I need the class library to work for all .NET frameworks. I have tried to include the NuGet package CoreCompat.System.Drawing, based on advise from this post. But this has been without effect, probably because MigraDoc is still trying to use the "original" System.Drawing library.



Is there any way, in which I can get my class library to work for .NET Core? Or am I out of luck...?



Note: The MigraDoc Core Package has nothing to do with the .NET Core Framework. The clash of names is merely a coincidence.










share|improve this question
















I have made a class library for PDF-generation. It is implemented using PDFshart-MigraDoc (the core package*). The class library itself is made with .NET Standard as its target framework.



I can use the class library in classic C# projects (like WinForms), but if I try to use it with .NET Core 2.0, I get the following error:




Could not load file or assembly 'System.Drawing.Common,
Version=0.0.0.0, Culture=neutral, PublicKeyToken=xxxx'. The system
cannot find the file specified.




I guess the reason for this, could be that MigraDoc is using 'System.Drawing' in its implementation, which is (as far as I know) not supported by the .NET Core framework.



However, that doesn't really solve my problem, which is that I need the class library to work for all .NET frameworks. I have tried to include the NuGet package CoreCompat.System.Drawing, based on advise from this post. But this has been without effect, probably because MigraDoc is still trying to use the "original" System.Drawing library.



Is there any way, in which I can get my class library to work for .NET Core? Or am I out of luck...?



Note: The MigraDoc Core Package has nothing to do with the .NET Core Framework. The clash of names is merely a coincidence.







c# .net-core system.drawing migradoc






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jul 4 '18 at 11:58







Noceo

















asked Jul 4 '18 at 10:15









NoceoNoceo

1,06711638




1,06711638












  • Do you target Windows only or other platforms also?

    – Vive la déraison
    Jul 4 '18 at 11:50











  • Currently the only target is Windows, yes. It was originally made for a WinForms project, but not a colleague of mine, also wants to use it in a .NET Core 2.0 project.

    – Noceo
    Jul 4 '18 at 12:00

















  • Do you target Windows only or other platforms also?

    – Vive la déraison
    Jul 4 '18 at 11:50











  • Currently the only target is Windows, yes. It was originally made for a WinForms project, but not a colleague of mine, also wants to use it in a .NET Core 2.0 project.

    – Noceo
    Jul 4 '18 at 12:00
















Do you target Windows only or other platforms also?

– Vive la déraison
Jul 4 '18 at 11:50





Do you target Windows only or other platforms also?

– Vive la déraison
Jul 4 '18 at 11:50













Currently the only target is Windows, yes. It was originally made for a WinForms project, but not a colleague of mine, also wants to use it in a .NET Core 2.0 project.

– Noceo
Jul 4 '18 at 12:00





Currently the only target is Windows, yes. It was originally made for a WinForms project, but not a colleague of mine, also wants to use it in a .NET Core 2.0 project.

– Noceo
Jul 4 '18 at 12:00












2 Answers
2






active

oldest

votes


















0














The MigraDoc/PDFsharp Core packages were created long before .NET Core was even announced. "Core" has a different meaning for those MigraDoc packages and they do use System.Drawing.



It's not a bug that the Core package uses System.Drawing.



There are third-party ports of PDFsharp for .NET Core like this one:
https://github.com/groege/PdfSharpCore

Maybe one of these ports is an option for you.



Maybe there are portable replacements for System.Drawing.






share|improve this answer























  • Thanks for your answer. I should have noted, that I am aware, that the MigraDoc Core is completely unrelated to .NET Core. I was looking for an alternative, which does not require a complete rewrite of my class library. I will try out some of the MigraDoc ports you mentioned. Replacing System.Drawing doesn't seem like its possible.

    – Noceo
    Jul 4 '18 at 11:56


















0














I found a port for PDFSharp & MigraDoc here on github which usesSystem.Drawing.Common and works with .Net Core.



I had the same and got it fully working.



Note: You may need to add System.Drawing.Common Nuget Package in your .Net Core project.






share|improve this answer

























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f51171232%2fmigradoc-and-net-core-2-0%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    The MigraDoc/PDFsharp Core packages were created long before .NET Core was even announced. "Core" has a different meaning for those MigraDoc packages and they do use System.Drawing.



    It's not a bug that the Core package uses System.Drawing.



    There are third-party ports of PDFsharp for .NET Core like this one:
    https://github.com/groege/PdfSharpCore

    Maybe one of these ports is an option for you.



    Maybe there are portable replacements for System.Drawing.






    share|improve this answer























    • Thanks for your answer. I should have noted, that I am aware, that the MigraDoc Core is completely unrelated to .NET Core. I was looking for an alternative, which does not require a complete rewrite of my class library. I will try out some of the MigraDoc ports you mentioned. Replacing System.Drawing doesn't seem like its possible.

      – Noceo
      Jul 4 '18 at 11:56















    0














    The MigraDoc/PDFsharp Core packages were created long before .NET Core was even announced. "Core" has a different meaning for those MigraDoc packages and they do use System.Drawing.



    It's not a bug that the Core package uses System.Drawing.



    There are third-party ports of PDFsharp for .NET Core like this one:
    https://github.com/groege/PdfSharpCore

    Maybe one of these ports is an option for you.



    Maybe there are portable replacements for System.Drawing.






    share|improve this answer























    • Thanks for your answer. I should have noted, that I am aware, that the MigraDoc Core is completely unrelated to .NET Core. I was looking for an alternative, which does not require a complete rewrite of my class library. I will try out some of the MigraDoc ports you mentioned. Replacing System.Drawing doesn't seem like its possible.

      – Noceo
      Jul 4 '18 at 11:56













    0












    0








    0







    The MigraDoc/PDFsharp Core packages were created long before .NET Core was even announced. "Core" has a different meaning for those MigraDoc packages and they do use System.Drawing.



    It's not a bug that the Core package uses System.Drawing.



    There are third-party ports of PDFsharp for .NET Core like this one:
    https://github.com/groege/PdfSharpCore

    Maybe one of these ports is an option for you.



    Maybe there are portable replacements for System.Drawing.






    share|improve this answer













    The MigraDoc/PDFsharp Core packages were created long before .NET Core was even announced. "Core" has a different meaning for those MigraDoc packages and they do use System.Drawing.



    It's not a bug that the Core package uses System.Drawing.



    There are third-party ports of PDFsharp for .NET Core like this one:
    https://github.com/groege/PdfSharpCore

    Maybe one of these ports is an option for you.



    Maybe there are portable replacements for System.Drawing.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Jul 4 '18 at 11:50









    Vive la déraisonVive la déraison

    15.4k252116




    15.4k252116












    • Thanks for your answer. I should have noted, that I am aware, that the MigraDoc Core is completely unrelated to .NET Core. I was looking for an alternative, which does not require a complete rewrite of my class library. I will try out some of the MigraDoc ports you mentioned. Replacing System.Drawing doesn't seem like its possible.

      – Noceo
      Jul 4 '18 at 11:56

















    • Thanks for your answer. I should have noted, that I am aware, that the MigraDoc Core is completely unrelated to .NET Core. I was looking for an alternative, which does not require a complete rewrite of my class library. I will try out some of the MigraDoc ports you mentioned. Replacing System.Drawing doesn't seem like its possible.

      – Noceo
      Jul 4 '18 at 11:56
















    Thanks for your answer. I should have noted, that I am aware, that the MigraDoc Core is completely unrelated to .NET Core. I was looking for an alternative, which does not require a complete rewrite of my class library. I will try out some of the MigraDoc ports you mentioned. Replacing System.Drawing doesn't seem like its possible.

    – Noceo
    Jul 4 '18 at 11:56





    Thanks for your answer. I should have noted, that I am aware, that the MigraDoc Core is completely unrelated to .NET Core. I was looking for an alternative, which does not require a complete rewrite of my class library. I will try out some of the MigraDoc ports you mentioned. Replacing System.Drawing doesn't seem like its possible.

    – Noceo
    Jul 4 '18 at 11:56













    0














    I found a port for PDFSharp & MigraDoc here on github which usesSystem.Drawing.Common and works with .Net Core.



    I had the same and got it fully working.



    Note: You may need to add System.Drawing.Common Nuget Package in your .Net Core project.






    share|improve this answer





























      0














      I found a port for PDFSharp & MigraDoc here on github which usesSystem.Drawing.Common and works with .Net Core.



      I had the same and got it fully working.



      Note: You may need to add System.Drawing.Common Nuget Package in your .Net Core project.






      share|improve this answer



























        0












        0








        0







        I found a port for PDFSharp & MigraDoc here on github which usesSystem.Drawing.Common and works with .Net Core.



        I had the same and got it fully working.



        Note: You may need to add System.Drawing.Common Nuget Package in your .Net Core project.






        share|improve this answer















        I found a port for PDFSharp & MigraDoc here on github which usesSystem.Drawing.Common and works with .Net Core.



        I had the same and got it fully working.



        Note: You may need to add System.Drawing.Common Nuget Package in your .Net Core project.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Mar 8 at 14:30









        kalehmann

        2,7331023




        2,7331023










        answered Mar 8 at 14:22









        Vikas RanaVikas Rana

        1




        1



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f51171232%2fmigradoc-and-net-core-2-0%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme

            Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

            2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived