首页 > 解决方案 > Json Provider 失败,路径中有非法字符

问题描述

我正在使用 FSharp Json 提供程序。我正在部署到 Azure Web 应用程序。当我部署到 Dev 时,它工作正常。当我部署到 TEST 时,它失败并显示以下消息:

{"Message":"发生错误。","ExceptionMessage":"路径中有非法字符。","ExceptionType":"System.ArgumentException","StackTrace":" at System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks (String fullPath)\r\n at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)\r\n at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)\r\n at FSharp.Data.Runtime.IO.asyncRead@237-5 .Invoke(Unit unitVar) 在 C:\Git\FSharp.Data\src\CommonRuntime\IO.fs:line 237\r\n

该类型由

type Entities = JsonProvider<"./someDir/Sample.json">

并在此处生成错误

let response = Entities.Load(currentUri)

我在生成类型时尝试删除文件并内联示例 json,但这也失败并出现相同的错误代码。

有人有想法么?是当前的Uri吗?在所有环境中都是相同的

标签: f#-data

解决方案


我放手了,选择了 web 客户端和 newtonsoft。


推荐阅读