3

I'm trying to run Raven Db in embeddedmode on Winhost, but I get a securityexception with following stacktrace:

   System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
   System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission cap, StackCrawlMark& stackMark) +31
   System.Security.CodeAccessPermission.Demand() +46
   System.Net.NetworkInformation.IPGlobalProperties.GetIPGlobalProperties() +53
   Raven.Database.Util.PortUtil.FindPort() in PortUtil.cs:34
   Raven.Database.Util.PortUtil.GetPort(String portStr) in PortUtil.cs:17
   Raven.Database.Config.InMemoryRavenConfiguration.Initialize() in InMemoryRavenConfiguration.cs:109
   Raven.Database.Config.RavenConfiguration.LoadConfigurationAndInitialize(IEnumerable`1 values) in RavenConfiguration.cs:30
   Raven.Database.Config.RavenConfiguration..ctor() in RavenConfiguration.cs:19
   Raven.Client.Embedded.EmbeddableDocumentStore.get_Configuration() in EmbeddableDocumentStore.cs:45
   Raven.Client.Embedded.EmbeddableDocumentStore.set_DataDirectory(String value) in EmbeddableDocumentStore.cs:69
   StingyPrice.MvcApplication.Application_Start() in Global.asax.cs:42

My application is running in full trust (internal) mode but judging from that exception I'm making a bold assumption that Raven will never run unless they loosen their security policies.

Am I wrong or is it possible to run Raven Db at Winhost? Also if it's not possible, a list of shared web hosting providers that can run Raven Db would be much appreciated. :-)

Jukka Puranen
  • 8,026
  • 6
  • 27
  • 25
  • 1
    Was this ever resolved? Did you get it working? – K Ronning Jan 20 '12 at 07:34
  • 1
    Nope, I guess I just assumed that it would not work. I started running EC2 micro instance instead. At least there I get full control of everything and no problems running a site with raven there. :-) – Jukka Puranen Jan 20 '12 at 17:55

3 Answers3

2

RavenDB requires full trust to run in server / embedded mode.

Ayende Rahien
  • 22,925
  • 1
  • 36
  • 41
  • 1
    I'm running my app on full trust and Raven in embedded mode but does Raven always call Raven.Database.Util.PortUtil.FindPort()? Because I have UseEmbeddedHttpServer option off and still I get that FindPort() call. – Jukka Puranen Aug 11 '11 at 06:45
  • @Ayende: do you really need the call to FindPort() when using the embedded store? I also thought that setting `UseEmbeddedHttpServer = false` would let me get rid of this security exception... but it's not the case. The code still calls that method. – Leniel Maccaferri Feb 04 '12 at 01:24
1

Yes, you can run RavenDB on Winhost. You will need to change the web.config file, set the correct Raven/WorkingDir and enable Full trust.

When running, you will get an error regarding WebSockets. You can open up a support ticket to have it enabled and have “Overlapped Recycle” disabled.

I (employee of Winhost) wrote an official startup guide here if you want to try out RavenDb on Winhost.

Ray
  • 67
  • 7
  • You wouldn't have happened to write a similar guide in regards to MSSQL and using Entity Framework using Code First, possibly? Or know about such a resource. – Chef_Code Dec 31 '16 at 02:23
1

You can try www.winhost.com as described here:

How can I run RavenDB in a shared hosting environment?

It has the so desired Full Trust Allowed which is something one should look for in the case of RavenDB to avoid the current security permissions problems...

NOTE: I just tried this host and can confirm that it works great with RavenDB in Full Trust... :-)

Community
  • 1
  • 1
Leniel Maccaferri
  • 100,159
  • 46
  • 371
  • 480