Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Sharepoint gac Deployed Dll throwing Permission Error

3 views
Skip to first unread message

Kumar T@discussions.microsoft.com Pradeep Kumar T

unread,
Sep 7, 2009, 2:04:01 AM9/7/09
to
Hi ,
I am verry new to share point ,I am trying to use Enterprise Library Logging
application block for Logging Exceptions and debug informations from
webparts,For this
I have created one Base class some what like below

Step 1:-
public partial class QWebPartBase : System.Web.UI.WebControls.WebParts.WebPart
{
#region Private Variables and constant declaration
public static QLogger _log;
#endregion

public QWebPartBase()
{
SPSecurity.RunWithElevatedPrivileges(delegate()
{
_log = QLogger.Current ??
QLogger.GetLogger(AuthenticationHelper.GetLoggingIdentity());
_log.ApplicationID =
ApplicationSetting.GetStringValue(ApplicationSetting.ApplicationId);
_log.Debug("Entering webpart");

});

}


}

Step 2:-
Modified Web.config file to have the following entries

<configSections>
<section name="enterpriseLibrary.ConfigurationSource"
type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ConfigurationSourceSection,
Microsoft.Practices.EnterpriseLibrary.Common, Version=4.1.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirepermission="false" />
</configSections>
..............
<enterpriseLibrary.ConfigurationSource selectedSource="File Configuration
Source">
<sources>
<add name="File Configuration Source"
type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.FileConfigurationSource,
Microsoft.Practices.EnterpriseLibrary.Common, Version=4.1.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35"
filePath="App_EntLib.config" />
</sources>
</enterpriseLibrary.ConfigurationSource>

.........

Step 3:-
public class QWebPart01 : QWebPartBase
{
…………….
……………
protected override void CreateChildControls()
{
base.CreateChildControls();
……….
QWebPartBase._log.Debug("Inside
CreateChildControls of QWebPart01");
}
}


Initially i tried to deploy to bin but due to permission errors we changed
plan and now deploying to GAC but still iam not able to write log to file
,getting FileIOPermission,I think GAC deployed dll is having full rights,but
still iam getting permission error,Please any one can help me where am i
missing,

Thanks in advance
Pradeep

0 new messages