首页 > 解决方案 > 使用 F# NuGet 包生成器添加内容文件

问题描述

我正在尝试将一个 dll 添加到使用我的 NuGet 包的任何项目的输出文件夹中。我使用 F# 来构建它,但对于如何让它工作已经没有想法了。

用于构建的 F# 代码:

NuGet (fun p ->
        {p with
            Authors = ["Delsys"]
            References = ["DelsysAPI.dll"]
            Project = projectName
            Description = projectDescription
            OutputPath = artifactsNuGetDir
            Summary = projectSummary
            WorkingDir = packagingDir
            Version = version
            Files = [(@"**/SiUSBXp.dll", Some @"lib", Some @"")]
            }) "DelsysAPI.nuspec"

SiUSBXp dll 存在于我的 NuGet 包中,但当我包含并使用此 NuGet 包构建时,它不会复制到输出文件夹中。任何帮助或见解都会很棒。

编辑:

我在这个问题上取得了一些进展。我不确定是否应该打开一个新线程,但基本上当我将该文件添加为内容文件时,F# nuget 创建者认为我的项目根文件夹是 C 驱动器。

Running build failed.
Error:
System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\DelsysAPI\bin\Release'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileSystemEnumerableIterator`1.CommonInit()
   at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost)
   at System.IO.Directory.GetFiles(String path, String searchPattern, SearchOption searchOption)
   at FSI_0005.Build-core.clo@45-2.Invoke(Unit _arg3) in C:\Users\path\to\project\DelsysAPI\trunk\build-core.fsx:line 52
   at Fake.TargetHelper.runSingleTarget(TargetTemplate`1 target) in D:\code\fake\src\app\FakeLib\TargetHelper.fs:line 626

这是新的 F# NuGet 规范代码:

    NuGet (fun p ->
        {p with
            Authors = ["Delsys"]
            References = ["DelsysAPI.dll"]
            Project = projectName
            Description = projectDescription
            OutputPath = artifactsNuGetDir
            Summary = projectSummary
            WorkingDir = packagingDir
            Version = version
            Files = [(@"SiUSBXp.dll", Some @"", Some @"")]
            }) ("DelsysAPI.nuspec")  

我试过使用SOURCE_DIRECTORY但它认为该值也是 C:/ProjectFolder 。

标签: f#nugetf#-fake

解决方案


推荐阅读