I found the following error while uploading blog to a dedicated hosting server in a sub directory inside its wwwroot and it should have worked on www.websitename.com/blog. See how horrifying this error is:
Could not load file or assembly 'WebPageSecurity' or one of its dependencies. The system cannot find the file specified.
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.FileNotFoundException: Could not load file or assembly 'WebPageSecurity' or one of its dependencies. The system cannot find the file specified.
Source Error:
Assembly Load Trace: The following information can be helpful to determine why the assembly 'WebPageSecurity' could not be loaded.
How I did it
What I did was quite normal i.e. uploaded files to sub directory /blog/ opened IIS7 and converted blog directory to an Application. I left the application pool as it is "Default Application Pool"
Finding Solution
Google was really not helpful in this issue. A lot of people have the same issue but no proper solution. The missing dll "WebPageSecurity" was actually present in the root website's bin folder so it was obvious that blog app is confusing with its parent's resources. So to isolate them I tried to create a new application pool for blog but no luck. Also I tried to place the blog files outside of wwwroot. Nothing really worked.
What worked for me :)
I noticed that the Default Application Pool is working in Integrated Mode, just for a try I changed the Mode of Blog application pool to Classic... Lo and behold. It worked like a charm. Give it a try if you're stuck on the same island.
Could not load file or assembly 'WebPageSecurity' or one of its dependencies. The system cannot find the file specified.
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.FileNotFoundException: Could not load file or assembly 'WebPageSecurity' or one of its dependencies. The system cannot find the file specified.
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 'WebPageSecurity' could not be loaded.
How I did it
What I did was quite normal i.e. uploaded files to sub directory /blog/ opened IIS7 and converted blog directory to an Application. I left the application pool as it is "Default Application Pool"
Finding Solution
Google was really not helpful in this issue. A lot of people have the same issue but no proper solution. The missing dll "WebPageSecurity" was actually present in the root website's bin folder so it was obvious that blog app is confusing with its parent's resources. So to isolate them I tried to create a new application pool for blog but no luck. Also I tried to place the blog files outside of wwwroot. Nothing really worked.
What worked for me :)
I noticed that the Default Application Pool is working in Integrated Mode, just for a try I changed the Mode of Blog application pool to Classic... Lo and behold. It worked like a charm. Give it a try if you're stuck on the same island.