Logo
My Account |  Site Map | Contact Us  
 The same content in Microsoft HTML help file format is included in the download package.
Using with .NET Core

Some EO products require extensive access to system level API calls, as a result, at present all EO products only officially support Windows platform.

Consequently, even though it is possible for you to use EO products in a .NET Core project, it only works if you target your project to the traditional .NET Frameworks instead of .NET Core runtime. As such the steps listed below only allows you to compile your project against .NET Core runtime.

Steps for .NET Core 1.0

Please follow these steps to use EO products in a .NET Core project:

  1. Make sure your .NET Core projects can target traditional .NET Frameworks.

    Examine the frameworks section of your project.json file. It may look like:

    project.json
    "frameworks": {
        "netcoreapp1.0": {}
    }

    The above project only runs on .NET Core runtime. The following code adds .NET Framework 4.6.1 support:

    project.json
    "frameworks": {
        "netcoreapp1.0": {},
        "net461": {}
    }
  2. Move dependency for Microsoft.NETCore.App into the "netcoreapp1.0" section of the frameworks section.

    If your project previously only support .NET Core, you may see this block in your dependencies section on the root level:

    project.json
    "Microsoft.NETCore.App": {
        "version": "1.0.1",
        "type": "platform"
    }

    Since Microsoft.NETCore.App only supports .NET Core, this is a .NET Core only dependency, it should not apply to .NET Framework 4.6.1. As such you must move it into the "netcoreapp1.0" section inside the frameworks section:

    project.json
    "frameworks": {
        "netcoreapp1.0": {
            "dependencies": {
                "Microsoft.NETCore.App": {
                    "version": "1.0.1",
                    "type": "platform"
                }
            }
        },
        "net461": { }
    }
  3. Add reference to EO nuget packages

    Since EO products only runs on traditional .NET framework, you must add EO packages into the regular .NET framework's dependencies section instead of the root dependencies. The following code add reference to EO.Pdf:

    project.json
    "frameworks": {
        "netcoreapp1.0": {
            "dependencies": {
                "Microsoft.NETCore.App": {
                    "version": "1.0.1",
                    "type": "platform"
                }
            }
        },
        "net461": {
            "dependencies": {
                "EO.Pdf": "17.0.43"
            }
        }
    }

Now you can select to run your application targeting .NET Framework 4.6.1 and use EO.Pdf in your .NET Core project:

Steps for .NET Core 2.0

Visual Studio 2017 streamlined .NET Core 2.0 support and it is much easier to configure a .NET Core 2.0 application to target .NET Framework. Follow these steps to add .NET Framework targeting to a .NET Core 2.0 project:

  1. Open your .NET Core 2.0 project in Visual Studio (requires 2017.15.3 and newer);
  2. Open solution Explorer, right click your project, then select "Edit your_project_file", here your_project_file is the project file name, for example, Test.csproj. This will open the project file in XML Editor;
  3. Modify the following tag:
    xml
    <TargetFramework>netcoreapp2.0</TargetFramework>

    To:

    xml
    <TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>

    Note that:

    • TargetFramework becomes TargetFrameworks;
    • net461 has been added into the list. You can use other frameworks too, for example, net45;
  4. Save the changes and Visual Studio should reload the project;
  5. You can now add EO DLL references the same way as you do with a .NET Framework project;

Now you will be able to build the project both as .NET Core and .NET Framework.


Direct link to this topic