【问题标题】:RavenDB EmbeddedDocumentStorage in Medium Trust中等信任的 RavenDB EmbeddedDocumentStorage
【发布时间】:2012-01-30 10:19:54
【问题描述】:

我正在尝试在 Medium Trust 中使用 RavenDB,我想尝试嵌入式模型,因为我使用的托管(便宜)不允许安装服务。我的初始化代码如下:

private void ConfigureStorage()
    {
        store = new EmbeddableDocumentStore();
        store.Configuration.DefaultStorageTypeName = "munin";
        store.Configuration.DataDirectory=Server.MapPath("$/App_Data");
        store.Initialize();
    }

在完全信任的情况下工作,但在 Medium 中它会抛出:

请求“System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089”类型的权限失败。 使用以下堆栈跟踪:

[SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
   System.StubHelpers.StubHelpers.DemandPermission(IntPtr pNMD) +0
   Microsoft.VisualBasic.CompilerServices.NativeMethods.GlobalMemoryStatusEx(MEMORYSTATUSEX& lpBuffer) +0
   Microsoft.VisualBasic.Devices.InternalMemoryStatus.Refresh() +68
   Microsoft.VisualBasic.Devices.InternalMemoryStatus.get_TotalPhysicalMemory() +11
   Microsoft.VisualBasic.Devices.ComputerInfo.get_TotalPhysicalMemory() +49
   Raven.Database.Config.InMemoryRavenConfiguration.GetDefaultMemoryCacheLimitMegabytes() +301
   Raven.Database.Config.InMemoryRavenConfiguration.Initialize() +631
   Raven.Database.Config.RavenConfiguration.LoadConfigurationAndInitialize(IEnumerable`1 values) +311
   Raven.Database.Config.RavenConfiguration..ctor() +189
   Raven.Client.Embedded.EmbeddableDocumentStore.get_Configuration() +99
   Wine2.MvcApplication.ConfigureStorage() +84
   Wine2.MvcApplication.Application_Start() +84

Raven 版本为:573 版

是否有一些方法可以使其在中等信任下工作,或者这种情况不受支持?

【问题讨论】:

  • 我会用 616 再试一次,我记得看到 Ayende 说他在过去一周修复了一些中型信托问题。还有为什么是munin?
  • @Phil 感谢您的帮助:munin 不是中等信任度中唯一可用的选项吗?
  • 这也是我在签约托管公司时的疑问......我要求他们提供免费时间,只是为了测试一下,看看事情是否按预期工作! :] 他们会回来的。我希望他们允许我在签订计划之前对其进行测试。

标签: ravendb embedded-database medium-trust


【解决方案1】:

在严格的中等信任度下,RavenDB 将无法工作。 但是有很多托管公司在 RavenDB 工作的地方提供托管服务,因为他们调整了权限。

【讨论】:

  • 很高兴知道他们调整的方式,BTW build 616 似乎是编译 w/o AllowPartiallyTrustedCaller
  • 嗯...我在 Medium Trust 中遇到了同样的问题。我什至尝试了嵌入式商店的最新不稳定版本 1.0.638。一样。 :( 要查看我得到的异常,只需访问该站点:schetine.siteprofissional.com 任何想法 Ayende?没有办法克服这个问题?
【解决方案2】:

根据我的经验,我刚刚放弃尝试在 Medium Trust 中运行嵌入式商店。我遇到了您问题中描述的相同错误。

要克服这个问题,您可以尝试www.winhost.com,如下所述:

How can I run RavenDB in a shared hosting environment?

它具有非常理想的允许完全信任,这是在 RavenDB 的情况下应该寻找的东西,以避免当前的安全权限问题...

注意:我刚刚试用了这个主机,可以确认它在完全信任的情况下与 RavenDB 配合得很好...... :-)

【讨论】:

猜你喜欢
  • 2012-06-06
  • 1970-01-01
  • 2010-12-22
  • 1970-01-01
  • 1970-01-01
  • 2010-09-13
  • 2011-02-01
  • 2010-11-22
  • 1970-01-01
相关资源
最近更新 更多