Ad esempio, se desidero solo pacchetti per .Net Platform Standard. Ora sto cercando un pacchetto, provo a installarlo, ottenendo:È possibile filtrare i pacchetti di nuget dalla piattaforma supportata?
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.
e devo ricominciare. Vedo le piattaforme supportate. Ciò significa che le informazioni sono lì.
Edit: Sarà meglio se posso impostare un filtro in Visual Studio, ma non vedo tale, non l'ho visto anche in nuget.org. Quindi la domanda è: esiste un modo per ottenere pacchetti solo per determinate piattaforme (che significa filtro per ricerca di una piattaforma per qualcosa). Quello che mi interessa è .Net Platform Standard. Spero, non vedi qualcosa di vago qui.
Edit: Here is the search api da nuget.org
<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>
Quando uso Search function, opere parametro 'searchterm', ma non il parametro 'targetFramework'.
Un altro Edit: VisualStudio NuGet richiesta HTTP in Fiddler:
GET /api/v2/Search()?$filter=IsAbsoluteLatestVersion&searchTerm='mvv'&targetFramework='netcoreapp1.0'&includePrerelease=true&$skip=0&$top=26 HTTP/1.1
Il framework di destinazione viene impostato automaticamente da Visual Studio NuGet Package Manager. Ciò che in realtà non funziona è il parametro targetFramework nelle API di ricerca da NuGet
trovandoli localmente, su nuget.org o durante la compilazione? Mi piacerebbe ottenere la mia prima taglia, ma la domanda è un po 'vaga;) – Thomas
@Thomas nessun motivo per cui una risposta non può includere tutte e tre! Rendendola applicabile a un pubblico più ampio aumenta le tue possibilità su un distintivo d'oro lucido o due;) – Thebluefish