OSX上的嵌入式ravendb(单声道)

时间:2011-12-28 01:40:21

标签: .net macos mono ravendb

使用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上工作,或者我有一个很大的盲点。后者似乎更有可能,所以帮助我:)。

1 个答案:

答案 0 :(得分:4)

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

相关问题