2011-12-28 53 views
2

使用Mono 2.10.8與RavenDB構建.NET4應用程序。當我試着使用OSX上嵌入文檔店裏做任何事情,我得到以下異常:OSX上的嵌入式ravendb(單聲道)

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()發現:

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上工作,要麼我有一個大的盲點。後者似乎更有可能,所以幫助我:)

+0

我認爲這將有助於如果你不使用dmcs編譯器。 http://stackoverflow.com/questions/3882590/why-are-there-four-mono-c-sharp-compilers – kenny 2011-12-28 04:03:41

+0

@kenny我不明白這是如何成爲一個因素,即使有可能我可能會使用DMCS以外的其他程序來編譯.NET4應用程序。 – 2011-12-28 04:15:54

回答

4

如果你明確指定一個端口,你將能夠超出這個,默認端口是*,這意味着「找到我一個打開」。指定8080,看看這是否有幫助。請注意,我們不支持Mac上的RavenDB Embedded。 你可以在Mac上運行RavenDB客戶端。

+1

不支持嵌入的內存,這就是爲什麼它正在初始化連接,即使我沒有指定連接。 2個問題 - 有沒有希望在某個時候增加這種支持;是否有一個原因,EmbeddableDocumentStore不會搶先在OSX上拋出不受支持的異常?謝謝! – 2011-12-28 15:29:36