Can I use NHibernate on GoDaddy?

后端 未结 3 415
感情败类
感情败类 2020-12-30 12:04

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 t

相关标签:
3条回答
  • 2020-12-30 12:40

    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

    0 讨论(0)
  • 2020-12-30 12:47

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

    • nhibernate proxy generator
    • does nhibernate work with medium trust out of the box?
    • NHibernate 2.1.2 in medium trust
    • NHibernate 2 + Fluent Nhibernate medium trust

    Bottom line: use a compile-time proxy generator.

    0 讨论(0)
  • 2020-12-30 12:56

    Yes you can, try edit web.config file.

    <system.web>
        <trust level="Full" />
    </system.web>
    
    0 讨论(0)
提交回复
热议问题