新的UWP项目(以10586或AU版本为目标,无所谓)。 当安装包Google.Apis
1.20(或其它版本)project.lock.json包含以下行:NuGet恢复/安装/锁定UWP应用程序的无效dll变体
{
"version": 2,
"targets": {
"UAP,Version=v10.0": {
"Google.Apis/1.20.0": {
"type": "package",
"dependencies": {
"Google.Apis.Core": "1.20.0",
...
"System.Threading.Tasks": "4.0.11"
},
"compile": {
"lib/win81/Google.Apis.PlatformServices.dll": {},
"lib/win81/Google.Apis.dll": {}
},
"runtime": {
"lib/win81/Google.Apis.PlatformServices.dll": {},
"lib/win81/Google.Apis.dll": {}
}
},
我很奇怪,为什么编译/运行节点所引用的lib/win81而package itself包含netstandard1.3
文件夹。
如果我安装了Google.Apis.Core
,它从此包中引用netstandard1.3
个dll,而仍然从Google.Apis
中获取win81
个dll。
想知道,为什么是这样以及如何强制它使用netstandard1.3呢?
这里是封装的结构和nuspec:
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
<id>Google.Apis</id>
<version>1.20.0</version>
<title>Google APIs Client Library</title>
<authors>Google Inc.</authors>
<owners>google-apis-packages</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0</licenseUrl>
<projectUrl>https://developers.google.com/api-client-library/dotnet</projectUrl>
<description>The Google APIs Client Library is a runtime client for working with Google services.
The library supports service requests, media upload and download, etc.
Supported Platforms:
- .NET Framework 4.5 and 4.6
- NetStandard1.3
- Windows 8 Apps
- Windows Phone 8 and 8.1
- Portable Class Libraries</description>
<tags>Google</tags>
<dependencies>
<group>
<dependency id="Google.Apis.Core" version="1.20.0" />
<dependency id="Zlib.Portable.Signed" version="1.11.0" />
</group>
<group targetFramework=".NETFramework4.5">
<dependency id="log4net" version="2.0.3" />
<dependency id="Google.Apis.Core" version="1.20.0" />
<dependency id="Zlib.Portable.Signed" version="1.11.0" />
</group>
<group targetFramework=".NETStandard1.3">
<dependency id="Google.Apis.Core" version="1.20.0" />
<dependency id="System.Collections" version="4.0.11" />
<dependency id="System.Diagnostics.Debug" version="4.0.11" />
<dependency id="System.IO" version="4.1.0" />
<dependency id="System.IO.Compression" version="4.1.0" />
<dependency id="System.Linq" version="4.1.0" />
<dependency id="System.Net.Http" version="4.1.0" />
<dependency id="System.Net.Primitives" version="4.0.11" />
<dependency id="System.Reflection" version="4.1.0" />
<dependency id="System.Runtime" version="4.1.0" />
<dependency id="System.Runtime.Extensions" version="4.1.0" />
<dependency id="System.Text.Encoding" version="4.0.11" />
<dependency id="System.Threading" version="4.0.11" />
<dependency id="System.Threading.Tasks" version="4.0.11" />
<dependency id="System.Reflection.TypeExtensions" version="4.1.0" />
</group>
</dependencies>
</metadata>
</package>
吴,谢谢你的回答。我的问题不是关于特定的软件包,而是总体上为什么NuGet选择使用win81 lib而不是netstandard13 lib。 –
@AlexSorokoletov,它取决于发布者如何打包库。请参考上面已经提到的创建一个包。 –
不幸的是,这不是我正在寻找的答案。我有确切的图书馆和确切的目标项目。 .nuspec中的哪一行触发NuGet或VS通过netstandard13使用win81库? –