MarcinJuraszek / CloneExtensions

Clone extension method library. Performs fast, deep or shallow clone using simple assignment operations generated by Expression Tree runtime code compilation.
Apache License 2.0
115 stars 30 forks source link

System.IO.FileNotFoundException: Could not load file or assembly 'System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes'. The system cannot find the file specified #10

Closed mattbrewer closed 7 years ago

mattbrewer commented 7 years ago

I have an application that has been using netcoreapp1.0 for the last few months. I found your library and saw that you recently upgraded it to work with netcoreapp1.1. I changed my application and libraries to netcoreapp1.1 in my project.json and recompiled with your nuget package.

When GetClone() is called, it throws: System.TypeInitializationException: The type initializer for 'CloneExtensions.CloneFactory' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes'. The system cannot find the file specified.

The framework section of my app is:

"frameworks": {
    "netcoreapp1.1": {
      "dependencies": {
      },
      "imports": [
        "dotnet5.6",
        "portable-net451+win8"
      ]
    }
  }

Have you tested this library with those imports?

mattbrewer commented 7 years ago

I figured it out. I was loading the old dll into my debugger, which was still on netcoreapp1.0. I am not sure how this even worked.

Everything is fine now. Thanks for a great library!

MarcinJuraszek commented 7 years ago

I'm glad you figured it out!