Mailkit: Support .NET Core 1.0

Created on 30 Jun 2016  路  7Comments  路  Source: jstedfast/MailKit

I was trying to build a project that uses MailKit on ASP Core RTM and here is what I have got after dotnet restore

Package Portable.BouncyCastle 1.8.1 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0) / osx.10.11-x64. Package Portable.BouncyCastle 1.8.1 supports:
      - dotnet (.NETPlatform,Version=v5.0)
      - monoandroid (MonoAndroid,Version=v0.0)
      - monotouch (MonoTouch,Version=v0.0)
      - net45 (.NETFramework,Version=v4.5)
      - net46 (.NETFramework,Version=v4.6)
      - portable-monoandroid10+monotouch10+net40+sl5+win8+wp8+wpa81+xamarinios10+xamarinmac20 (.NETPortable,Version=v0.0,Profile=net4+sl5+wp8+win8+wpa81+MonoTouch10+MonoAndroid10+xamarinmac20+xamarinios10)
      - portable-monoandroid10+monotouch10+net45+win8+wpa81+xamarinios10+xamarinmac20 (.NETPortable,Version=v0.0,Profile=net45+win8+wpa81+MonoTouch10+MonoAndroid10+xamarinmac20+xamarinios10)
      - uap10.0 (UAP,Version=v10.0)
      - win8 (Windows,Version=v8.0)
      - wpa81 (WindowsPhoneApp,Version=v8.1)
      - xamarinios (Xamarin.iOS,Version=v0.0)
      - xamarinmac (Xamarin.Mac,Version=v0.0)
    One or more packages are incompatible with .NETCoreApp,Version=v1.0 (osx.10.11-x64).

Most helpful comment

I've just released MimeKit and MailKit 1.4.0 to nuget with support for .NET Core 1.0

All 7 comments

I haven't had time to port MimeKit and MailKit to .NET Core 1.0 yet. I've been planning to do it this coming weekend.

Great news!

Thanks!

I've just released MimeKit and MailKit 1.4.0 to nuget with support for .NET Core 1.0

I'm getting an "object not found" error from nuget when I attempt to install 1.4.0. Here's my project.json:

{
    "userSecretsId": "esnext-aspnetcore",

    "dependencies": {
        "Microsoft.NETCore.App": {
            "version": "1.0.0",
            "type": "platform"
        },
        "Microsoft.ApplicationInsights.AspNetCore": "1.0.0",
        "Microsoft.AspNetCore.Authentication.Cookies": "1.0.0",
        "Microsoft.AspNetCore.Diagnostics": "1.0.0",
        "Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.0.0",
        "Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0",
        "Microsoft.AspNetCore.Mvc": "1.0.0",
        "Microsoft.AspNetCore.Razor.Tools": {
            "version": "1.0.0-preview2-final",
            "type": "build"
        },
        "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
        "Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
        "Microsoft.AspNetCore.StaticFiles": "1.0.0",
        "Microsoft.EntityFrameworkCore.SqlServer": "1.0.0",
        "Microsoft.EntityFrameworkCore.Tools": {
            "version": "1.0.0-preview2-final",
            "type": "build"
        },
        "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
        "Microsoft.Extensions.Configuration.Json": "1.0.0",
        "Microsoft.Extensions.Configuration.UserSecrets": "1.0.0",
        "Microsoft.Extensions.Logging": "1.0.0",
        "Microsoft.Extensions.Logging.Console": "1.0.0",
        "Microsoft.Extensions.Logging.Debug": "1.0.0",
        "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0",
        "Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
            "version": "1.0.0-preview2-final",
            "type": "build" 
        },
      "Microsoft.VisualStudio.Web.CodeGenerators.Mvc": {
        "version": "1.0.0-preview2-final",
        "type": "build"
      },
      "IdentityModel": "2.0.0-beta5"     
    },

    "tools": {
        "Microsoft.AspNetCore.Razor.Tools": {
            "version": "1.0.0-preview2-final",
            "imports": "portable-net45+win8+dnxcore50"
        },
        "Microsoft.AspNetCore.Server.IISIntegration.Tools": {
            "version": "1.0.0-preview2-final",
            "imports": "portable-net45+win8+dnxcore50"
        },
        "Microsoft.EntityFrameworkCore.Tools": {
            "version": "1.0.0-preview2-final",
            "imports": [
                "portable-net45+win8+dnxcore50",
                "portable-net45+win8"
            ]
        }, 
        "Microsoft.Extensions.SecretManager.Tools": {
            "version": "1.0.0-preview2-final",
            "imports": "portable-net45+win8+dnxcore50"
        },
        "Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
            "version": "1.0.0-preview2-final",
            "imports": [
                "portable-net45+win8+dnxcore50",
                "portable-net45+win8"
            ]
        }
    },

    "frameworks": {
        "netcoreapp1.0": {
            "imports": [
                "dotnet5.6",
                "dnxcore50",
                "portable-net45+win8"
            ]
        }
    },

    "buildOptions": {
        "emitEntryPoint": true,
        "preserveCompilationContext": true,
        "compile": {
            "exclude": [
                "node_modules",
                "jspm_packages"
            ]
        }
    },

    "runtimeOptions": {
        "gcServer": true
    },

    "publishOptions": {
        "include": [
            "wwwroot",
            "Views",
            "appsettings.json",
            "web.config"
        ]
    },

    "scripts": {
        "prepublish": [ "npm install", "bower install", "gulp clean", "gulp min" ],
        "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
    }
}

I honestly have no clue how to debug your problem because I barely understand project.json at all, so forgive my ignorance, but perhaps you just need a newer version of nuget.exe?

@Dima4ka Do you have this working with the latest .NET Core release?

@jasonhjohnson Yes it odes.

Here is my project.json for reference.

{
    "userSecretsId": "secret",
    "version": "1.0.0",
    "authors": [
        "Dmytro Bogatov"
    ],
    "dependencies": {
        "Npgsql": "3.1.*",
        "Npgsql.EntityFrameworkCore.PostgreSQL": "1.0.0",
        "Npgsql.EntityFrameworkCore.PostgreSQL.Design": "1.0.0",
        "Microsoft.EntityFrameworkCore.SqlServer": "1.0.0",
        "Microsoft.EntityFrameworkCore.SqlServer.Design": "1.0.0",
        "Microsoft.EntityFrameworkCore.Sqlite": "1.0.0",
        "Microsoft.EntityFrameworkCore.Sqlite.Design": "1.0.0",
        "Microsoft.EntityFrameworkCore.InMemory": "1.0.0",
        "Microsoft.AspNetCore.Authentication.Cookies": "1.0.0",
        "Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.0.0",
        "Microsoft.AspNetCore.Diagnostics": "1.0.0",
        "Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0",
        "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
        "Microsoft.AspNetCore.Mvc": "1.0.0",
        "Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
        "Microsoft.AspNetCore.StaticFiles": "1.0.0",
        "Microsoft.Extensions.Configuration.Json": "1.0.0",
        "Microsoft.Extensions.Configuration.UserSecrets": "1.0.0",
        "Microsoft.Extensions.Logging": "1.0.0",
        "Microsoft.Extensions.Logging.Console": "1.0.0",
        "Microsoft.Extensions.Logging.Debug": "1.0.0",
        "Microsoft.AspNetCore.Session": "1.0.0",
        "Npm.js": "2.13.1",
        "MailKit": "1.4.0-*",
        "Microsoft.AspNetCore.Cors": "1.0.0",
        "Microsoft.NETCore.App": {
            "type": "platform",
            "version": "1.0.0"
        }
    },
    "frameworks": {
        "netcoreapp1.0": {
            "imports": "dnxcore50"
        }
    },
    "tools": {
        "Microsoft.AspNetCore.Razor.Tools": "1.0.0-*",
        "Microsoft.EntityFrameworkCore.Tools": "1.0.0-*",
        "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-*",
        "Microsoft.Extensions.SecretManager.Tools": "1.0.0-*"
    },
    "runtimeOptions": {
        "gcServer": false,
        "gcConcurrent": true
    },
    "buildOptions": {
        "emitEntryPoint": true,
        "preserveCompilationContext": true,
        "compile": {
            "exclude": [
                "wwwroot",
                "node_modules"
            ]
        }
    },
    "publishOptions": {
        "include": [
            "appsettings.json",
            "wwwroot",
            "Views"
        ],
        "exclude": [
            "**.user",
            "**.vspscc"
        ]
    },
    "scripts": {
        "prepublish": [
            "npm install",
            "bower install --allow-root",
            "gulp clean",
            "gulp min",
            "gulp ts-debug"
        ]
    }
}
Was this page helpful?
0 / 5 - 0 ratings