EntityFramework Commands in ASP.Net 5 Class Library Package?

前端 未结 1 1884
野的像风
野的像风 2020-12-30 09:37

I am trying to develop my first ASP.Net web application and in my solution I have two projects. A Web Application and Class Library (Package). When

相关标签:
1条回答
  • 2020-12-30 10:27

    I suppose that the reason of your problem have pure technical nature. The announcement declares renaming of dnx451 to net451 and dnxcore50 to dotnet5.4, but one recommend to use such renaming only for class libraries (which you publich on NuGet for example to share with other). If I understand you correctly, that you develop application which uses class libraries and thus you should use dnxcore50 instead of dotnet5.4. Thus you need just rename the string "dotnet5.4" to the string "dnxcore50" in the fileproject.json` to fix the problem.

    Independent from the above recommendation I want to add my understanding of your problem, why you get the error about EntityFramework.Command 7.0.0-rc1-final.

    I understand the renaming of frameworks as the step in direction to future changes which plan Microsoft. On the other side all names of frameworks will be interpreted just as different names. I suggest you to compare the information about the dependencies displayed on the page https://www.nuget.org/packages/EntityFramework.Commands/7.0.0-rc1-final from the corresponding information from https://www.nuget.org/packages/EntityFramework.MicrosoftSqlServer/7.0.0-rc1-final. The dependencies of EntityFramework.MicrosoftSqlServer (which have no problems with the usage of dotnet5.4) looks like on the picture

    I marked read the part responsible for dotnet5.4. On the other side the dependencies of EntityFramework.Commands looks like on the picture below:

    where there are no ".NETPlatform 5.4" section which corresponds the new name dotnet5.4.

    I suppose that it's a bug in the part of project.json of EntityFramework.Commands:

    "netcore50": {
      "bin": {
        "assembly": "lib\\netcore50\\_._"
      }
    }
    

    I suppose that one have to change netcore50 to dotnet5.4 in the lines to support new framework name dotnet5.4 correctly. One chould replace the content of "netcore50" to the copy from dnxcore50 (see the lines):

    "dotnet5.4": {
      "dependencies": {
        "Microsoft.AspNet.Hosting.Abstractions": "1.0.0-*",
        "Microsoft.Dnx.Runtime": "1.0.0-*",
        "Microsoft.Extensions.CommandLineUtils.Sources": {
          "version": "1.0.0-*",
          "type": "build"
        },
        "Microsoft.Extensions.PlatformAbstractions": "1.0.0-*",
        "System.Console": "4.0.0-*",
        "System.IO.FileSystem": "4.0.1-*"
      }
    }
    

    Probably one should event increase some version numbers of the dlls referenced above, but you still will be not able to use EntityFramework.Commands under "dotnet5.4" till the new fixed version will be published.

    UPDATED: I posed the issue to the EntityFramework developer team. I'll include the response from Microsoft on the issue after I'll get it.

    0 讨论(0)
提交回复
热议问题