ExceptionHandling block 4.1 in ASP.NET 3.5 app

Topics: Exception Handling Application Block, Logging Application Block
Apr 7, 2010 at 7:58 PM

Hi there,

After migrating the application to test environment it was working as expected.

But after migrating to live environment from test, getting the below exception. I did not build the website after deplying on production server IIS.

Is it the reason?

Message: The current build operation (build key Build Key[Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicyImpl, UAAExceptionPolicy]) failed: The current build operation (build key Build Key[Microsoft.Practices.EnterpriseLibrary.Logging.LogWriter, null]) failed: Access to the path 'C:\Documents and Settings\xxxxx\My Documents\Visual Studio 2008\WebSites\SiteName' is denied
Your help is appreciated.
Apr 8, 2010 at 3:06 AM
Edited Apr 8, 2010 at 3:07 AM

Hi sukumarraju,

I have able to reproduce the error encountered by logging a trace log to a directory that I don't have any permission. Given this, have you already checked if the said directory in your error message exists in your production server? And if correct permission is set properly in the said directory?

If this doesn't help, can you provide more contexts what your "UAAExceptionPolicy" do in your web app?

HTH,

~ginkapitan

Apr 8, 2010 at 8:41 AM

Hi ginkapitan,

Thanks for your prompt response.

I wonder why it works fine on some occassions and it throws the above copied exception just once in  a while?

If the read access is the problem on the specified location it should throw the exception all the time. But it works fine most of the time and throwing the exception once in a while.

Am I missing something here. I think that ASPNET running as Windows Service trying to access that folder. Please correct me if i m incorrect.

sukumarraju

Apr 8, 2010 at 9:31 AM

I'm really not sure why this seems to be intermittent but I would highly recommend to use other directory location not something like this one "'C:\Documents and Settings\xxxxx\My Documents\Visual Studio 2008\WebSites\SiteName'" given that this WebApp is usually being migrated to different environment.

Yes, the identity that is running your Web App is indeed a big factor you need to consider too.

Since your WebApp is hosted in IIS you need to make sure that the identity that running your WebApp has the required access rights to the directory that you are using.

Hope this helps,

~ginkapitan

Oct 12, 2010 at 8:50 PM

Hi there,

After long time AGAIN getting the same exception. Please note the exception stack below.

Your help is appreciated.

An unhandled exception occurred:
Message: The current build operation (build key Build Key[Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicyImpl, UAAExceptionPolicy]) failed: The current build operation (build key Build Key[Microsoft.Practices.EnterpriseLibrary.Logging.LogWriter, null]) failed: Access to the path 'C:\Documents and Settings\xxxx\My Documents\Visual Studio 2008\WebSites\xxxx' is denied. (Strategy type ConfiguredObjectStrategy, index 2) (Strategy type ConfiguredObjectStrategy, index 2)

 Stack Trace:
   at Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicy.GetExceptionPolicy(Exception exception, String policyName, ExceptionPolicyFactory factory) in c:\Builds\EntLibV4\Latest\Source\Blocks\ExceptionHandling\Src\ExceptionHandling\ExceptionPolicy.cs:line 157
   at Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicy.HandleException(Exception exceptionToHandle, String policyName, ExceptionPolicyFactory policyFactory) in c:\Builds\EntLibV4\Latest\Source\Blocks\ExceptionHandling\Src\ExceptionHandling\ExceptionPolicy.cs:line 63
   at Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicy.HandleException(Exception exceptionToHandle, String policyName) in c:\Builds\EntLibV4\Latest\Source\Blocks\ExceptionHandling\Src\ExceptionHandling\ExceptionPolicy.cs:line 54
   at UserSearch.Search() in w:\webpages\Search.aspx.cs:line 903
   at UserSearch.btnSearch_Click(Object sender, EventArgs e) in w:\webpages\xxxx\Search.aspx.cs:line 237
   at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
   at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


Oct 13, 2010 at 7:38 AM

Discussion continued in this thread.

 

Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com