[CLOSED] WebPart and access denied to web.config

  1. #1

    [CLOSED] WebPart and access denied to web.config

    Hi,
    I have sharepoint webpart using Ext.Net, and some problems with configuration.
    Why does it need access to web.config there? is there a way to avoid that ?

    .WebPartException: Access to the path 'C:\inetpub\wwwroot\wss\VirtualDirectories\80\web.config' is denied. ---> System.UnauthorizedAccessException: Access to the path 'C:\inetpub\wwwroot\wss\VirtualDirectories\80\web.config' is denied. 
       at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) 
       at 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) 
       at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy) 
       at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) 
       at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize) 
       at System.IO.StreamReader..ctor(String path, Boolean detectEncodingFromByteOrderMarks) 
       at Ext.Net.ResourceHandler.HasHandler() 
       at Ext.Net.ResourceManager.GetWebResourceUrl(Type type, String resourceName) 
       at Ext.Net.ResourceManager.RegisterClientScriptIncludeInternal(Type type, String resourceName) 
       at Ext.Net.XControl.RegisterScripts(List`1 scripts, ResourceManager rm) 
       at Ext.Net.XControl.RegisterScripts(ResourceManager rm) 
       at Ext.Net.XControl.RegisterScripts() 
       at Ext.Net.XControl.SetResources() 
       at Ext.Net.XControl.PreRenderAction()
    Last edited by Daniil; Mar 21, 2011 at 7:11 PM. Reason: [CLOSED]
  2. #2
    Hi,

    ResourceManager checks that Ext.Net resource handler is registered in the web.config.
    If the handler is not registered then WebResource.axd handler will be used.

    If you cannot give permissions to read web.config and you are sure that the handler is registered then please add the following code in your Global.asax file (for example, in the Application_Start method)
    HttpContext.Current.Application["HasHandler"] = true;
    HttpContext.Current.Application["HasModule"] = true;
  3. #3
    Hi,

    Please note that ResourceManager can try to read extnet section in web.config to determine predefined properties therefore i recommend to give permission to read web.config

Similar Threads

  1. Fileuploadfield in one click - htmlfile access is denied error
    By vishal.jhala@gmail.com in forum 1.x Help
    Replies: 1
    Last Post: Aug 08, 2011, 6:05 PM
  2. FitLayout inside webpart
    By niceguymattx in forum 1.x Help
    Replies: 3
    Last Post: Apr 30, 2010, 8:47 AM
  3. Replies: 0
    Last Post: Oct 30, 2009, 3:57 AM
  4. Replies: 3
    Last Post: Aug 13, 2009, 2:38 PM
  5. [CLOSED] htmlFile: Access Denied
    By speedstepmem2 in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 27, 2009, 11:40 AM

Posting Permissions