runtime: Manifest mismatch exception when referencing Microsoft.NETCore.App 1.2.0 for an application targeting netcoreapp1.0

dotnet --version: 1.0.0-preview2-1-003180 (This CLI which supports netcoreapp1.1 > netstandard1.7

project.json:

{
  "buildOptions": {
   "emitEntryPoint": true
  },
  "frameworks": {
    "netcoreapp1.0": {
      "dependencies": {
        "Microsoft.NETCore.App": {
          "type": "platform",
          "version": "1.2.0-*"
        },
        "System.ComponentModel.TypeConverter": "4.4.0-*"
      }
    }
  }
}

Program.cs

public class Program
{
    public static void Main() => System.Console.WriteLine("Hello World!");
}

Running dotnet run on the project fails with

Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'System.Threading, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
   at System.Console.EnsureInitialized[T](T& field, Func`1 initializer)
   at System.Console.get_Out()
   at System.Console.WriteLine(String value)
   at Program.Main() in \mna-2\Program.cs:line 3

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 19 (17 by maintainers)

Most upvoted comments

I suppose another option is 4. Make build / publish smarter about deciding when to copy things app local.