例如,如果我只想要.Net Platform Standard的包。现在我正在寻找一个包,尝试安装它,得到:
error: Package <name> is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0).
Package <name> supports: portable-win81+wpa81 (.NETPortable,Version=v0.0,Profile=Profile32)
error: One or more packages are incompatible with .NETCoreApp,Version=v1.0.
我必须重新开始。我看到了支持的平台。这意味着,信息就在那里。
编辑:如果我可以在Visual Studio中设置过滤器会更好,但我没有看到,我还没有在nuget.org中看到它。所以问题是:有没有办法只为特定平台获取包(这意味着通过平台搜索过滤器)。我感兴趣的是.Net Platform Standard。我希望,你在这里看不到含糊不清的东西。
编辑: 来自nuget.org的Here is the search api
<edmx:Edmx xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx" Version="1.0">
<edmx:DataServices xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" m:DataServiceVersion="2.0" m:MaxDataServiceVersion="2.0">
<Schema xmlns="http://schemas.microsoft.com/ado/2006/04/edm" Namespace="NuGetGallery.OData">
<EntityType Name="V2FeedPackage" m:HasStream="true">...</EntityType>
</Schema>
<Schema xmlns="http://schemas.microsoft.com/ado/2006/04/edm" Namespace="NuGetGallery">
<EntityContainer Name="V2FeedContext" m:IsDefaultEntityContainer="true">
<EntitySet Name="Packages" EntityType="NuGetGallery.OData.V2FeedPackage"/>
<FunctionImport Name="Search" ReturnType="Collection(NuGetGallery.OData.V2FeedPackage)" EntitySet="Packages">
<Parameter Name="searchTerm" Type="Edm.String" FixedLength="false" Unicode="false"/>
<Parameter Name="targetFramework" Type="Edm.String" FixedLength="false" Unicode="false"/>
<Parameter Name="includePrerelease" Type="Edm.Boolean" Nullable="false"/>
</FunctionImport>
<FunctionImport Name="FindPackagesById" ReturnType="Collection(NuGetGallery.OData.V2FeedPackage)" EntitySet="Packages">
<Parameter Name="id" Type="Edm.String" FixedLength="false" Unicode="false"/>
</FunctionImport>
<FunctionImport Name="GetUpdates" ReturnType="Collection(NuGetGallery.OData.V2FeedPackage)" EntitySet="Packages">
<Parameter Name="packageIds" Type="Edm.String" FixedLength="false" Unicode="false"/>
<Parameter Name="versions" Type="Edm.String" FixedLength="false" Unicode="false"/>
<Parameter Name="includePrerelease" Type="Edm.Boolean" Nullable="false"/>
<Parameter Name="includeAllVersions" Type="Edm.Boolean" Nullable="false"/>
<Parameter Name="targetFrameworks" Type="Edm.String" FixedLength="false" Unicode="false"/>
<Parameter Name="versionConstraints" Type="Edm.String" FixedLength="false" Unicode="false"/>
</FunctionImport>
</EntityContainer>
</Schema>
</edmx:DataServices>
</edmx:Edmx>
当我使用Search function时,&#39; searchTerm&#39;参数有效,但不是&#39; targetFramework&#39;参数。
另一个编辑:Fiddler中的VisualStudio NuGet HTTP请求:
GET /api/v2/Search()?$filter=IsAbsoluteLatestVersion&searchTerm='mvv'&targetFramework='netcoreapp1.0'&includePrerelease=true&$skip=0&$top=26 HTTP/1.1
目标框架是从Visual Studio NuGet Package Manager自动设置的。实际上不起作用的是来自NuGet
的搜索API中的targetFramework参数