我正在创建一个跨平台项目。我想将 sqlite-net 和 sqlite-net 扩展添加到我的共享项目中,似乎我无法将 nuget 包添加到我的共享项目中。有没有办法添加它,或者有另一种方法可以在共享项目中使用 sqlite 扩展而不导入 nuget 包
最佳答案
这就是答案: https://forums.xamarin.com/discussion/70403/add-nuget-packages-is-disabled
When you create a Forms app, the template will ask you if you want to use a Shared project or a Portable Class Library for your shared code. you most likely chose Shared project which is NOT a real project in that it doesn't compile to a DLL like other project types. therefore, you don't add nuget packages to a Shared project. the Shared project uses the nuget packages added to the iOS and Android projects.
think of a Shared project as a collection of source code that automatically gets transparently copied to each of the real projects that use it as if that shared source code was physically part of the real projects.
so if your shared code doesn't compile due to a missing nuget than you must add that nuget to both of your iOS and Android real projects.
关于c# - 如何将NugetPackages添加到共享项目?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54243602/