Problem when loading AlphaFS library when publishing website
Problem reported by Alexandre Boucher - January 19, 2017 at 9:29 AM
Resolved
I use FileUltimate successfully in development and production environments. However, when we use Visual Studio Publish functionnality to publish the website in production, we get an error saying it can't load AlphaFS. The error stays there for like a minute and then goes away. Everything is working fine, but having this temporary error at each site publication is very annoying. Here is the relevant IIS Exception log : 
 
Event code: 3005 
Event message: Une exception non gérée s'est produite. 
Event time: 2017-01-19 12:14:16 
Event time (UTC): 2017-01-19 17:14:16 
Event ID: 1fb4994ad7ce4b66878dec3bcdae1df9 
Event sequence: 1 
Event occurrence: 1 
Event detail code: 0 
 
Application information: 
    Application domain: /LM/W3SVC/25/ROOT-6-131293196563355281 
    Trust level: Full 
    Application Virtual Path: / 
    Application Path: D:\Solutions_Web\MaRuche\cms.maruche.ca\ 
    Machine name: PROD-WEB-R2 
 
Process information: 
    Process ID: 246488 
    Process name: w3wp.exe 
    Account name: IIS APPPOOL\cms.maruche.ca 
 
Exception information: 
    Exception type: InvalidOperationException 
    Exception message: La méthode d'initialisation de pré-démarrage de l'application PreApplicationStart de type GleamTech.DocumentUltimate.Web.DocumentUltimateWebConfiguration a levé une exception avec le message d'erreur suivant : Une exception a été levée par l'initialiseur de type pour 'GleamTech.DocumentUltimate.Web.DocumentUltimateWebConfiguration'..
   à System.Web.Compilation.BuildManager.InvokePreStartInitMethodsCore(ICollection`1 methods, Func`1 setHostingEnvironmentCultures)
   à System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods)
   à System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded)
   à System.Web.Compilation.BuildManager.ExecutePreAppStart()
   à System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException)

Une exception a été levée par l'initialiseur de type pour 'GleamTech.DocumentUltimate.Web.DocumentUltimateWebConfiguration'.
   à GleamTech.DocumentUltimate.Web.DocumentUltimateWebConfiguration.PreApplicationStart()

Une exception a été levée par l'initialiseur de type pour 'GleamTech.Configuration.ConfigurationBase`1'.
   à GleamTech.Reflection.AssemblyResourceStore..ctor(String name, Type assemblyResourceLocatorType, String overrideFolderPath)
   à GleamTech.DocumentUltimate.Web.DocumentUltimateWebConfiguration..cctor()

Impossible de charger le fichier ou l'assembly 'AlphaFS, Version=2.1.0.0, Culture=neutral, PublicKeyToken=4d31a58f7d7ad5c9' ou une de ses dépendances. Le fichier spécifié est introuvable.
   à GleamTech.Caching.DiskCache.set_Path(BackSlashPath value)
   à GleamTech.Web.GleamTechWebConfiguration.InitCurrent()
   à GleamTech.Configuration.ConfigurationBase`1..cctor()

 
 
Request information: 
    Request URL: https://cms.maruche.ca:443/Content/Images/microsite/maRuche.svg 
    Request path: /Content/Images/microsite/maRuche.svg 
    User host address: 24.226.148.159 
    User:  
    Is authenticated: False 
    Authentication Type:  
    Thread account name: IIS APPPOOL\cms.maruche.ca 
 
Thread information: 
    Thread ID: 117 
    Thread account name: IIS APPPOOL\cms.maruche.ca 
    Is impersonating: False 
    Stack trace:    à System.Web.Compilation.BuildManager.InvokePreStartInitMethodsCore(ICollection`1 methods, Func`1 setHostingEnvironmentCultures)
   à System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods)
   à System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded)
   à System.Web.Compilation.BuildManager.ExecutePreAppStart()
   à System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException)
 
 
Custom event details: 
EDIT:
Resolved by installing AlphaFS in the solution using this command in Nuget Package Manager:
Install-Package AlphaFS -Version 2.1.0
 

6 Replies

Reply to Thread
0
Cem Alacayir Replied
Employee Post
Do you confirm the error still happens with FileUltimate v5.7.1 (January 16, 2017) ?
0
Alexandre Boucher Replied
Yes I have FileUltimate 5.7.1 installed. Publishing locally in an empty folder and using IIS reproduced the issue. I resolved the issue by installing AlphaFS version 2.1, by running the following command in Nuget Package Manager:

Install-Package AlphaFS -Version 2.1.0
0
Cem Alacayir Replied
Employee Post
Yes that would be a temporary solution but normally you shouldn't need to do that because AlphaFS DLL is already embedded and should be automatically resolved. The problem is I could not replicate the error. It seems the error happens under certain conditions, maybe related to references in your project which change loading order in bin folder. When you have time, please give a try to the new build 5.7.2 (it's on nuget now)
1
Cem Alacayir Replied
Employee Post
FYI, I think we completely fixed it now in v5.7.3. 
v5.7.3 is now live on the web site and nuget.
 
It turned out the error was due to a stupid bug: 
The log file AssemblyResolver.log was locked when you first started your web app as expected but even if you restarted the web app it could stay locked.
Then during the next web app initialization, AssemblyResolver would fail initialization because it could not overwrite the log file AssemblyResolver.log.
It was hard to replicate because the file did not stay locked after every restart/recycle.
 
0
Alexandre Boucher Replied
Ok thanks I'll try this out soon, because installing the AlphaFS package did solve the issue when publishing locally, but did not solve it when publishing the website in production environment.

I'll try this and report if it works by the end of next week.
0
Alexandre Boucher Replied
I confirm that updating to v5.7.3 corrected the bug. Thanks for quick feedback and bug resolution.

Reply to Thread