ServiceStack F#示例无法启动 [英] ServiceStack F# sample fails starting

查看:60
本文介绍了ServiceStack F#示例无法启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用最新的ServiceStack运行此自托管示例版本(4.0.3)和最新的Mono/F#(3.2.5).

I'm trying to run this Self Hosting example, using latest ServiceStack release (4.0.3) and latest Mono/F# (3.2.5).

它失败,并出现appHost.Init()上的异常:

It fails with an exception on appHost.Init():

{System.IO.FileNotFoundException:找不到虚拟文件文件名:'<>.FSharpSignatureData.'
在<>/ServiceStack/VirtualPath/ResourceVirtualDirectory.cs:99}中的ServiceStack.VirtualPath.ResourceVirtualDirectory.CreateVirtualFile(System.String resourceName)[0x00033]处:System.IO.FileNotFoundException

{ System.IO.FileNotFoundException: Virtual file not found File name: '<>.FSharpSignatureData.'
at ServiceStack.VirtualPath.ResourceVirtualDirectory.CreateVirtualFile (System.String resourceName) [0x00033] in <>/ServiceStack/VirtualPath/ResourceVirtualDirectory.cs:99 } System.IO.FileNotFoundException

对于C#示例,不会发生同样的事情.

The same does not happen with the C# sample.

显然,它会查找一些文件作为F#程序集中的资源添加,但未映射到物理文件.

Apparently, it looks for some files added as resources in F# assemblies but not mapped to a physical file.

推荐答案

F#进行了一些元数据缓存",将资源(FSharpSignatureData,FSharpOptimizationData)放入程序集中.这会在ServiceStack设置其虚拟文件系统时引起问题,因为它想将这些资源映射到实际文件(我认为).

F# does some 'meta data caching' that puts resources (FSharpSignatureData, FSharpOptimizationData) into the assembly. This causes issues when ServiceStack sets up its virtual file system since it wants to map these resources to actual files (I think).

您可以通过添加标志 --nointerfacedata 来解决此问题.到构建/编译步骤. (在"VS属性">构建">其他标志"中)

You can get past this by adding the flag --nointerfacedata to the build/compile steps. (in VS Properties > Build > 'Other flags')

我一直打算将其发布到GitHub的问题页面.

I've been meaning to post this to the GitHub issues page.

这篇关于ServiceStack F#示例无法启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆