【问题标题】:embedded ravendb on OSX (mono)OSX 上的嵌入式 ravendb(单声道)
【发布时间】:2011-12-28 21:00:55
【问题描述】:

使用 Mono 2.10.8 使用 RavenDB 构建 .NET4 应用程序。当我尝试对 OSX 上的嵌入式文档存储执行任何操作时,出现以下异常:

System.NotSupportedException: This platform is not supported
  at System.Net.NetworkInformation.IPGlobalProperties.GetIPGlobalProperties () [0x00000] in <filename unknown>:0 
  at Raven.Database.Util.PortUtil.FindPort () [0x00000] in <filename unknown>:0 
  at Raven.Database.Util.PortUtil.GetPort (System.String portStr) [0x00000] in <filename unknown>:0 
  at Raven.Database.Config.InMemoryRavenConfiguration.Initialize () [0x00000] in <filename unknown>:0 
  at Raven.Database.Config.RavenConfiguration.LoadConfigurationAndInitialize (IEnumerable`1 values) [0x00000] in <filename unknown>:0 
  at Raven.Database.Config.RavenConfiguration..ctor () [0x00000] in <filename unknown>:0 
  at Raven.Client.Embedded.EmbeddableDocumentStore.get_Configuration () [0x00000] in <filename unknown>:0 

首先我尝试打开嵌入式商店并使用它。我查看了 IPGlobalProperties.GetIPGlobalProperties() 的 Mono 实现的源代码,发现:

public static IPGlobalProperties GetIPGlobalProperties ()
{
    PlatformID platform = Environment.OSVersion.Platform;
    if (platform != PlatformID.Unix)
    {
        return new Win32IPGlobalProperties();
    }
    if (Directory.Exists ("/proc"))
    {
        MibIPGlobalProperties mibIPGlobalProperties = new MibIPGlobalProperties ("/proc");
        if (File.Exists (mibIPGlobalProperties.StatisticsFile))
        {
            return mibIPGlobalProperties;
        }
    }
    if (Directory.Exists ("/usr/compat/linux/proc"))
    {
        MibIPGlobalProperties mibIPGlobalProperties = new MibIPGlobalProperties ("/usr/compat/linux/proc");
        if (File.Exists (mibIPGlobalProperties.StatisticsFile))
        {
            return mibIPGlobalProperties;
        }
    }
    throw new NotSupportedException ("This platform is not supported");
}

现在,我仍在学习 OSX 系统配置的来龙去脉(我一生都是 Windows 人),但我很确定我没有对我的系统配置做过任何愚蠢的事情。这告诉我,在当前 Mono 的实现中,这将永远在 OSX 上工作,或者我有一个很大的盲点。后者似乎更有可能,所以帮帮我:)

【问题讨论】:

  • 如果您不使用 dmcs 编译器,我认为这会有所帮助。 stackoverflow.com/questions/3882590/…
  • @kenny 我看不出这将是一个怎样的因素,即使我可能使用 DMCS 以外的东西来编译 .NET4 应用程序。

标签: .net macos mono ravendb


【解决方案1】:

如果您明确指定一个端口,您将能够超越该端口,默认端口是 *,这意味着“给我找一个打开的”。指定 8080 看看是否有帮助。请注意,我们不支持 Mac 上的 RavenDB Embedded。 不过,您可以在 Mac 上运行 RavenDB 客户端。

【讨论】:

  • 啊,不支持嵌入,这就是为什么它正在初始化连接,即使我没有指定连接。 2 个问题 - 是否希望在某个时候添加这种支持; EmbeddableDocumentStore 是否有理由不抢先在 OSX 上抛出不受支持的异常?谢谢!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-03-23
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多