添加 <trust level="Full" /> 时托管 WCF 服务时出错

Getting error while hosting WCF service when add <trust level="Full" />

我正在尝试在 "hostgator" 中托管 WCF 服务。我想设置信任级别,因为我收到安全权限错误。

当我在 web.config 中设置 Trust Level 时,出现错误。

web.config:

<location allowOverride="true">
    <system.web>
        <compilation debug="true" targetFramework="4.5.2"/>
        <identity impersonate="false" />
        <authentication mode="None" />
        <httpRuntime maxUrlLength="1024" relaxedUrlToFileSystemMapping="true"/>

        <customErrors mode="Off"></customErrors>
        <securityPolicy>
            <trustLevel name="Full" policyFile="internal"/>
        </securityPolicy>
    </system.web>
</location> 

错误:

An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

任何人都可以提出解决这个问题的方法吗?

enter image description here

根据 HostGator FAQ,您必须 运行 部分信任使用他们的共享主机:

No. The applications must be published in Medium Trust in order to run on the Windows Shared Server.

根据我的了解,您将无法在中等信任环境中使用 SDK。随着 Dynamics CRM 2016 扩展了对其 REST 的支持 API,这可能成为您的一个选择。