Click here to Skip to main content
15,881,455 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I I am using orchard 1.8.1 and try to install the theme Bootstrap and it gives me the following error. Can any one help me please?

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: ValueFactory attempted to access the Value property of this instance.
C#
Line 61:         // Load the log4net thread with additional properties if they are available
Line 62:         protected internal void AddExtendedThreadInfo() {
Line 63:             if (_shellSettings.Value != null) {
Line 64:                 ThreadContext.Properties["Tenant"] = _shellSettings.Value.Name;
Line 65:             }
Posted
Comments
Er. Puneet Goel 21-Jan-15 2:22am    
Let me know in case you need futher detials on the error in any move to get it solved.
Thanks

1 solution

Solution : Finally after lots of search and tries, just found that it seems to work if, in OrchardLog4netLogger.cs, we replace
C#
_shellSettings = new Lazy<shellsettings>(LoadSettings);</shellsettings>

With
C#
_shellSettings = new Lazy<shellsettings>(LoadSettings,
     System.Threading.LazyThreadSafetyMode.PublicationOnly);</shellsettings>


Then, all threads are allowed to run the initialization method. The first thread to complete initialization sets the value of the Lazy<t> instance.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900