feedburner

Subscribe

View Venkat Varkala\

Enterprise Library & Shared Hosting

Labels:

If you get below error that means either you don't have Enterprise Library installed on your machine or you don't have proper access to the System Registry. This generally happens if you do shared hosting of .NET App using Enterprise Library. Try taking off your Database Error Logging from web.config.

Server Error in '/' Application.

Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Logging.Database.Configuration.Design' or one of its dependencies. Access is denied.

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.IO.FileLoadException: Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Logging.Database.Configuration.Design' or one of its dependencies. Access is denied. 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.
Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.Practices.EnterpriseLibrary.Logging.Database.Configuration.Design' could not be loaded.
WRN: Assembly binding logging is turned OFF.

To enable assembly bind failure logging, set the registry value [HKLMSoftwareMicrosoftFusion!EnableLog] (DWORD) to 1.

Note: There is some performance penalty associated with assembly bind failure logging.

To turn this feature off, remove the registry value [HKLMSoftwareMicrosoftFusion!EnableLog].
Stack Trace:
[FileLoadException: Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Logging.Database.Configuration.Design' or one of its dependencies. Access is denied.]

   System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0

   System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +211

   System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +141

   System.Reflection.Assembly.Load(String assemblyString) +25

   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +32[ConfigurationErrorsException: Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Logging.Database.Configuration.Design' or one of its dependencies. Access is denied.]

   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +596

   System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +3479049

   System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +46

   System.Web.Configuration.AssemblyInfo.get_AssemblyInternal() +20

   System.Web.Compilation.CompilationUtil.GetTypeFromAssemblies(AssemblyCollection assembliesCollection, String typeName, Boolean ignoreCase) +136

   System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +318

   System.Web.Profile.ProfileBase.AddProfilePropertySettingsForCompilation(ProfilePropertySettingsCollection propertyCollection, Hashtable ht, String groupName) +279

   System.Web.Profile.ProfileBase.GetPropertiesForCompilation() +400

   System.Web.Compilation.ProfileBuildProvider.get_HasCompilableProfile() +17

   System.Web.Compilation.ProfileBuildProvider.GetProfileTypeFromAssembly(Assembly assembly, Boolean isPrecompiledApp) +10

   System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories) +3450630

   System.Web.Compilation.BuildManager.CompileCodeDirectories() +525

   System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +448

[HttpException (0x80004005): Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Logging.Database.Configuration.Design' or one of its dependencies. Access is denied.]

   System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +57

   System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +612

   System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters) +456

[HttpException (0x80004005): Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Logging.Database.Configuration.Design' or one of its dependencies. Access is denied.]

   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +3426855

   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +88

   System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +149

Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42

ASP.NET 2.0 Error: unable to cast masterpage

Labels:

In ASP.NET 2.0, each master page and web form can compile into a separate assembly. Unless we establish a reference between two assemblies, the types inside each assembly cannot see one another. The @ MasterType directive with a VirtualPath attribute ensures the web form’s assembly will reference the master page assembly.

<%@ MasterType VirtualPath="~/m_masterpage.master" %>

in code behind load event

    protected void Page_Load(object sender, EventArgs e)     {                 Master.HideLastUpdated = true;                 Master.PageTitle = "Page title here";      }