Can't connect to my site

Discussion in 'General troubleshooting' started by JackWebb, Feb 5, 2010.

  1. And it used to work!

    After re-creating my site with a fresh copy of my local version, and a freshly made connection to my site through IIS v7, I now get the following message:

    ****************START_ERROR_MESSAGE***********************
    Server Error in '/' Application.
    --------------------------------------------------------------------------------

    Security Exception
    Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

    Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:


    [SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
    System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
    System.Security.CodeAccessPermission.Demand() +58
    System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) +644
    System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) +66
    System.Configuration.Internal.InternalConfigHost.StaticOpenStreamForRead(String streamName) +85
    System.Configuration.Internal.InternalConfigHost.System.Configuration.Internal.IInternalConfigHost.OpenStreamForRead(String streamName, Boolean assertPermissions) +124
    System.Configuration.Internal.InternalConfigHost.System.Configuration.Internal.IInternalConfigHost.OpenStreamForRead(String streamName) +10
    System.Configuration.Internal.DelegatingConfigHost.OpenStreamForRead(String streamName) +13
    System.Configuration.UpdateConfigHost.OpenStreamForRead(String streamName) +46
    System.Configuration.BaseConfigurationRecord.InitConfigFromFile() +293
    ****************END_ERROR_MESSAGE*************************

    I don't recall doing anything special in my web.config the first time, and I don't think I made any changes since I got it working initially.

    Does anyone know what I'm missing, or what I can do to pinpoiint where the error lies?

    Thanks,
    Jack Webb
     
  2. AHA!
    I found it!

    I needed some authority, i.e.

    <trust level="High" />
    in the <system.web></system.web>
    section of web.config.

    Although I still don't understand why I didn't have this problem before.

    And also whether or not what I did to fix it is the correct thing to do.

    So, I still would appreciate some thoughts on the subject.

    Thanks,
    JJW
     
  3. Ray

    Ray

    The trust level value is stored in your applications web.config file. If you set it before but uploaded a new web.config file, the value may have gotten over written.
     

Share This Page