8

A comment from .Net Hosting (Flexible Medium Trust) says.

Godaddy is medium trust, which means that u can't use stuff like IL emit(Nhibernate needs this for proxying)

Is it true? Is there anyone using NHibernate on GoDaddy?

Community
  • 1
  • 1
AAP
  • 101
  • 3
  • 2
    This link may be of interest to you - http://www.gavaghan.org/blog/2007/08/21/nhibernate-in-a-medium-trust-environment/ – Dave Jan 28 '11 at 10:09

3 Answers3

4

I have successfully run Nhibernate 2.1 and now 3 in a medium trust environment. The only thing I had to do for NH3 was to download Castle source and modify the CommonAssemblyInfo.cs file so that Partially trusted callers is enabled.

You will need to reference the compiled castle dll's into NHibernates source and rebuild. You can reference all the compiled dll's into your project and viola.

[assembly: AllowPartiallyTrustedCallers()]

Everything else works great including proxies.

Additional -> it should be noted that I run this on Rackspace Cloud Medium trust levels and not on Go Daddy but I suspect/hope that it should be the same!

Edit To run nHibernate 3.2 in medium trust environments please see this link or this one

Rippo
  • 22,117
  • 14
  • 78
  • 117
2

There are many questions already on SO dealing with NHibernate + medium trust:

Bottom line: use a compile-time proxy generator.

Community
  • 1
  • 1
Mauricio Scheffer
  • 98,863
  • 23
  • 192
  • 275
  • I would recommend NH3 as compiling for medium trust is much easier. See my post for more info. – Rippo Jan 28 '11 at 16:34
0

Yes you can, try edit web.config file.

<system.web>
    <trust level="Full" />
</system.web>
Yaseen
  • 598
  • 6
  • 7