1

In the ASP.NET Core 1.0 I was using:

"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"

To run dotnet publish commands, but in the ASP.NET Core 1.1 I'm starting to get the following error:

Package Microsoft.AspNetCore.Server.IISIntegration.Tools 1.1.0-preview4-final is not compatible with net462 (.NETFramework,Version=v4.6.2). Package Microsoft.AspNetCore.Server.IISIntegration.Tools 1.1.0-preview4-final supports: netcoreapp1.0 (.NETCoreApp,Version=v1.0)

How can I still use "dotnet-publish-iis" with ASP.NET Core and regular .NET frameworks?

project.json:

{
  "dependencies": {
    "Dapper": "1.50.2",
    "log4net": "2.0.5",
    "Microsoft.AspNetCore.Authorization": "1.1.0",
    "Microsoft.AspNetCore.Diagnostics": "1.1.0",
    "Microsoft.AspNetCore.Routing": "1.1.0",
    "Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.1.0-preview4-final",
    "Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
    "Microsoft.AspNetCore.StaticFiles": "1.1.0",
    "Microsoft.Extensions.Caching.Abstractions": "1.1.0",
    "Microsoft.Extensions.Caching.Memory": "1.1.0",
    "Microsoft.Extensions.Configuration.FileExtensions": "1.1.0",
    "Microsoft.Extensions.Configuration.Json": "1.1.0",
    "Microsoft.Extensions.Logging.Console": "1.1.0",
    "Microsoft.Extensions.Logging.Debug": "1.1.0",
    "Microsoft.Extensions.Options.ConfigurationExtensions": "1.1.0"
  },
  "tools": {
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.1.0-preview4-final"
  },
  "frameworks": {
    "net462": {}
  },
  "buildOptions": {
    "emitEntryPoint": true,
    "preserveCompilationContext": true
  },
  "publishOptions": {
    "include": [
      "wwwroot",
      "web.config",
      "appsettings.json",
      "log4net.xml",
    ]
  },
  "scripts": {
    "prepublish": [ ],
    "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
  },
  "configurations": {
    "Debug": {
      "buildOptions": {
        "define": [
          "DEBUG",
          "TRACE"
        ]
      }
    },
    "Integration": {
      "buildOptions": {
        "define": [
          "DEBUG",
          "TRACE"
        ]
      }
    },
    "Production": {
      "buildOptions": {
        "define": [ "RELEASE", "TRACE" ],
        "optimize": true
      }
    }
  }
}
1
  • Can you share your project.json? Commented Dec 14, 2016 at 3:11

1 Answer 1

2

1) Update all packages to version 1.1.0 (and the corresponding previews for tools)

2) Tools packages should be installed into the tools section of project.json, not dependencies.

Hence, make sure you have added IISIntegration.Tools under tools section of project.json like this-

"tools": {
    ....
      "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.1.0-preview4-final",
    ....

3) Remove old project.lock.json and run dotnet restore again.

4) Now you can publish using - dotnet publish

See if this helps.

Sign up to request clarification or add additional context in comments.

2 Comments

Package Microsoft.AspNetCore.Server.IISIntegration.Tools 1.1.0-preview4-final is not compatible with net462 (.NETFramework,Version=v4.6.2). I'll add a copy of my project.json...
@J.Lennon Remove Microsoft.AspNetCore.Server.IISIntegration.Tools from dependencies. Refer my point no.2.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.