f#-data - 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吗?在所有环境中都是相同的
解决方案
我放手了,选择了 web 客户端和 newtonsoft。
推荐阅读
- java - JAVA:映射字符串键是什么意思?
- git - git merge master 覆盖更改
- jquery - 使用ajax访问API
- groovy - 仅在 grails spock 测试上乘以表达式时,列表收集不起作用
- swift - 如何将内存缓冲区转换为 swift 结构
- python - 在 Stack Overflow 上标记帖子时出现“您无权标记此帖子”
- ios - 为什么我的 UICollectionViewCell 没有用投影四舍五入?
- sql - 将 varchar 值“durationms”转换为数据类型 int 时转换失败
- regex - 正则表达式删除仅包含 1 个单词的所有行
- javascript - 在 JavaScript 中访问输入文件上传字段