Sunday, June 26, 2011

Solution: Could not load file or assembly or one of its dependencies System.IO.FileNotFoundException

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:
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.

Monday, May 16, 2011

jPlayer: An HTML5 and JQuery based audio video player

Today while searching something else, I came across a really cool thing. A flash-less media player.. wow. jPlayer is the HTML 5 and JQuery based audio, video player which supports playlists and multiple media formats such as OGV and M4V for video and OGA and MP3 for audio. I tested jPlayer on my system and surprisingly its compatible with most browsers such as Firefox 3.6, Safari 5.0, IE 6.0, and Chrome 11.0 and it worked seamlessly. Pretty impressive!

The cool thing is that it offers full control of it for JQuery programmers. You can set seek media, set volume, change video/audio, load playlist, and do a hell of things that most of the paid/expensive media players do such as Longtail's JW Player. Its Javascript based so most of the frontend developers would love it.






Download jPlayer | jPlayer Demos


Tuesday, January 18, 2011

How to send HTML email using Microsoft Outlook or Windows Live Mail

Few days ago, I had to send an html email with a fairly complex structure and with few images and backgrounds. I composed the html of it but when I was about to send it, I came to know that Microsoft Outlook, Express or Windows Live Mail (that’s what I use) doesn’t give any facility to this. It was quite surprising for me. I didn’t find any easy solution to it by searching on internet. Wise men say that create a way if you don’t find any.

As you may know, Windows Live Mail supports including HTML signatures and we can import external html files as well. This is what I incorporated.

Please follow the steps below:

Step 1: Compose the email


Compose the email in html. Read more information and guidelines on composing html emails here.
  1. Create new html file and compose it according to your requirements
  2. Save it as an html file on your computer (emailtemplate.html in our case)

This is how our email looks in design view. I used few <p>, <strong> , <img> and <table> tags for instance.


Step 2: Create new Signature


In your Windows Live Mail(Or Outlook)
  1. Go to Tools > Options
  2. Go to Signatures tab
  3. Press New Button
  4. Select File
  5. And browse the HTML file that you just created.



Step 3:  Insert in your email

  1. Compose new email
  2. From Signatures drop down
  3. Select the latest signature that you just created (HTML Email in our case)

Feel free to comment if you need more help!