使用 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 上无法工作,要么我有一个很大的盲点。后者似乎更有可能,所以帮帮我:)
最佳答案
如果您明确指定一个端口,您将能够超越该端口,默认端口是 *,这意味着“找到一个开放的端口”。指定 8080 并查看这是否有帮助。请注意,我们不支持 Mac 上的 RavenDB Embedded。 不过,您可以在 Mac 上运行 RavenDB 客户端。
关于.net - OSX 上的嵌入式 ravendb(单声道),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8651006/