locked
ASP.NET 4.5 Shared Web Hosting Trust Level RRS feed

  • Question

  • User-179587827 posted

    My hosting provider said that their shared hosting package does not support "Full Trust". It supports only "Medium Trust". Is it possible to run my application ( .NET 4.5 ) under "Medium Trust" level?

    I got error !! What can I do?

    Note: Hosting provider said that If I purchase cloud server package, then I will get "Full Trust" .

    Web config:

      <location path="www.asp.cinemadekhi.com" allowOverride="false">
        <system.web>
          <customErrors mode="Off"/>
          <trust level="Medium" />
    
          <authentication mode="None"/>
          <compilation debug="true" targetFramework="4.5"/>
          <httpRuntime targetFramework="4.5"/>
        </system.web>
      </location>

    Error:

    Server Error in '/' Application.
    Runtime Error
    Description: 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.
    
    Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
    
    
    <!-- Web.Config Configuration File -->
    
    <configuration>
        <system.web>
            <customErrors mode="Off"/>
        </system.web>
    </configuration>
    
    
    Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.
    
    
    <!-- Web.Config Configuration File -->
    
    <configuration>
        <system.web>
            <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
        </system.web>
    </configuration>

    Monday, April 25, 2016 9:18 AM

Answers

  • User-821857111 posted

    Is it possible to run my application ( .NET 4.5 ) under "Medium Trust" level?
    No. As far as the ASP.NET team are concerned, Medium Trust is "dead". See Levi Broderick's answer in this Stackoverflow thread: http://stackoverflow.com/a/22602024/134725

    I got error !! What can I do?
    First thing you should do is follow the instructions in the error message to identify the reason for the error. It will most likely be a SecurityException, resulting from the wrong trust level being applied.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, April 25, 2016 9:54 AM