我需要一些帮助来获取我的nuget软件包以支持UWP。我们的nuget软件包生成脚本是用F#编写的。我们已经使用了文件夹名称“ uap”和“ uap10.0”,但是当将其添加到UWP应用程序时,nuget软件包仍默认为(我相信)net45文件夹的dll。
我们还尝试了支持不同的体系结构,因为报告的错误是该软件包不支持“ win10-arm”-我们尝试过的另一个文件夹名称。该项目本身构建良好,所以我知道dll很好。只是文件夹结构在我们这边是错误的,我不确定什么是正确的。
以下是相关代码(这是有效的版本:
Target "ApiPackage" (fun _ ->
let androidDir = packagingDir @@ "lib/MonoAndroid"
let portableDir = packagingDir @@ "lib/net45/"
let netDir = packagingDir @@ "lib/netstandard2.0"
// let uwpDirARM = packagingDir @@ "runtimes/win10-arm/native"
// let uwpDir32 = packagingDir @@ "runtimes/win10-x86/native"
let iOSDir = packagingDir @@ "lib/monotouch"
let iOSDir2 = packagingDir @@ "lib/xamarinios"
CleanDirs [androidDir; portableDir]
CreateDir artifactsNuGetDir
trace "Copying Droid Files..."
let droidFiles = Directory.GetFiles((androidBuildDir @@ "Release"), "*.dll", SearchOption.AllDirectories)
for x in droidFiles do
printfn "%A " x
printfn ""
Copy androidDir droidFiles
let droidFiles = Directory.GetFiles((androidBuildDir @@ "Release"), "*.xml", SearchOption.AllDirectories)
for x in droidFiles do
printfn "%A " x
printfn ""
Copy androidDir droidFiles
trace "Copying NET Files..."
let netFiles = Directory.GetFiles((netBuildDir @@ "Release"), "*.dll", SearchOption.AllDirectories)
for x in netFiles do
printfn "%A " x
printfn ""
Copy netDir netFiles
let netFiles = Directory.GetFiles((netBuildDir @@ "Release"), "*.xml", SearchOption.AllDirectories)
for x in netFiles do
printfn "%A " x
printfn ""
Copy netDir netFiles
// let uwpFiles = Directory.GetFiles((uwpBuildDir @@ "Release"), "*.xml", SearchOption.AllDirectories)
// for x in uwpFiles do
// printfn "%A " x
// printfn ""
// Copy uwpDirARM uwpFiles
// Copy uwpDir32 uwpFiles
// let uwpFiles = Directory.GetFiles((uwpBuildDir @@ "Release"), "*.dll", SearchOption.AllDirectories)
// for x in uwpFiles do
// printfn "%A " x
// printfn ""
// Copy uwpDirARM uwpFiles
// Copy uwpDir32 uwpFiles
trace "Copying PCL Files..."
let pclFiles = Directory.GetFiles((portableBuildDir @@ "Release"), "*.dll", SearchOption.AllDirectories)
for x in pclFiles do
printfn "%A " x
printfn ""
Copy portableDir pclFiles
let pclFiles = Directory.GetFiles((portableBuildDir @@ "Release"), "*.xml", SearchOption.AllDirectories)
for x in pclFiles do
printfn "%A " x
printfn ""
Copy portableDir pclFiles
let netFiles2 = Directory.GetFiles((netBuildDir @@ "Release"), "*.dll", SearchOption.AllDirectories)
for x in netFiles2 do
printfn "%A " x
printfn ""
Copy portableDir netFiles2
let netFiles2 = Directory.GetFiles((netBuildDir @@ "Release"), "*.xml", SearchOption.AllDirectories)
for x in netFiles2 do
printfn "%A " x
printfn ""
Copy portableDir netFiles2
let iOSFiles = Directory.GetFiles((iosBuildDir @@ "Release"), "*.dll", SearchOption.AllDirectories)
for x in iOSFiles do
printfn "%A " x
printfn ""
Copy iOSDir iOSFiles
let iOSFiles = Directory.GetFiles((iosBuildDir @@ "Release"), "*.xml", SearchOption.AllDirectories)
for x in iOSFiles do
printfn "%A " x
printfn ""
Copy iOSDir iOSFiles
let iOSFiles2 = Directory.GetFiles((iosBuildDir @@ "Release"), "*.dll", SearchOption.AllDirectories)
for x in iOSFiles2 do
printfn "%A " x
printfn ""
Copy iOSDir2 iOSFiles2
let iOSFiles2 = Directory.GetFiles((iosBuildDir @@ "Release"), "*.xml", SearchOption.AllDirectories)
for x in iOSFiles2 do
printfn "%A " x
printfn ""
Copy iOSDir2 iOSFiles2
trace "Creating Nuget Package"
NuGet (fun p ->
{p with
Authors = ["OurCompany"]
References = ["OurAPI.dll"
"OurAPI.Android.dll"
"OurAPI.NET.dll"
// "OurAPI.UWP.dll"
"OurAPI.iOS.dll"]
Project = projectName
Description = projectDescription
OutputPath = artifactsNuGetDir
Summary = projectSummary
WorkingDir = packagingDir
Version = versionNumber
}) "OurAPI.nuspec"
)
该dll可在所有其他平台上使用。再次,我们尝试了文件夹名称“ uap”,“ uap10.0”,“ win10”,并根据体系结构(上面代码中的两个)对其进行命名。
任何帮助将不胜感激。谢谢!
答案 0 :(得分:0)
tfms的官方NuGet documentation说uap10.0
应该有用。
我建议创建一个独立的repro(nuspec +虚拟dll +虚拟uwp项目),并在NuGet上报告问题。