gpt4 book ai didi

f# - 引用外部程序集失败

转载 作者:行者123 更新时间:2023-12-02 15:16:56 25 4
gpt4 key购买 nike

我无法引用私有(private)程序集。我已经按照文档进行操作,但它仍然失败并显示错误消息:

2016-09-29T19:43:08.615 startup(2,1): error FS82: Could not resolve this reference. Could not locate the assembly "Backend.dll". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. (Code=MSB3245)

这是 run.fsx 文件:

#r "Backend.dll"

open System
open System.IO
open System.Net
open System.Net.Http.Headers
open System.Collections.Generic
open CoP

let createResponse json =
let responseJson = Request.handleJson json
let response = new HttpResponseMessage()
response.Content <- new StringContent(responseJson)
response.StatusCode <- HttpStatusCode.OK
response.Content.Headers.ContentType <- MediaTypeHeaderValue("application/json")
response

let Run (req: HttpRequestMessage) =
async {
let! json = req.Content.ReadAsStringAsync()
return createResponse json
} |> Async.StartAsTask

我还将 Backend.dll 放在函数所在文件夹内的 bin 文件夹中。

azure function folder structure

我错过了什么?

最佳答案

您似乎在 Azure Functions F# 实现中遇到了私有(private)程序集解析错误。我已打开此问题进行跟踪,并将在下一个版本中包含一个修复程序: https://github.com/Azure/azure-webjobs-sdk-script/issues/733

与此同时,您应该能够使用以下方式引用您的私有(private)程序集:

#r "bin/Backend.dll"

希望这对您有所帮助!

关于f# - 引用外部程序集失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39778875/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com