Could not load file or assembly 'Microsoft.Data.SqlClient

后端 未结 3 554
我寻月下人不归
我寻月下人不归 2020-12-07 02:52

I am calling a .net standard 2.0 library from a framework 4.7.2 test project sucessfully.

If I take my .net standard 2.0 dll (SBD.Standard) and create a new winform

3条回答
  •  余生分开走
    2020-12-07 03:25

    Although it would be ideal if the extra packages were added automatically.

    Assuming we have one .net standard project which depends on Microsoft.EntityFrameworkCore, Microsoft.EntityFrameworkCore.SqlServer and other packages. The expected behavior for us is to create a nuget package in whose xx.nuspec file has definitions about the dependencies.

    But there's one issue about nuget pack command, it can't work well for .net core/standard project. Both nuget pack and dotnet pack can create .net standard nuget packages successfully, but pack successfully doesn't mean good package.

    With the effect of the issue above, package created by nuget pack will lose some dependencies in Package.nuspec file. (Rename xx.nupkg to xx.zip, then we can check the content inside package, we'll see the xx.nuspec file)

    And above step can cause runtime error like missing assembly. So to make it ideal that the extra packages are added automatically and avoid missing reference, we recommend dotnet pack command for projects using PackageReference format. (No matter dotnet pack command locally or dotnet pack task in Azure Devops Piepilne)

提交回复
热议问题