例如,如果我只想要用于.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平台标准。我希望,您在这里没有看到一些模糊的东西。
编辑:来自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时,'searchTerm‘参数有效,但'targetFramework’参数无效。
另一个编辑: 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包管理器自动设置的。实际上不起作用的是来自NuGet的搜索api中的targetFramework参数
发布于 2016-06-06 16:43:23
正如在here中提到的,NuGet可以选择以框架为目标
存在与您的方案on github匹配的开放功能请求
当我遇到this page时,我觉得有可能使用power shell控制台脚本来实现您的过滤。请参阅“获取FrameworkName”一节。
https://stackoverflow.com/questions/37567221
复制相似问题