I've created a simple asp.net application to open a site and display the title of the corresponding web. But i'm getting FileNotFoundException while trying to open the site. The same code works perfectly when i run it in a console app.
My spec
Windows Server 2008 R2 x64, SharePoint 2007 x64, Visual Studio 2005.
My target for the asp.net app is set to 'Any CPU'.
As far as permissions is considered i've checked that the current identity using under which VS2005 hosts the asp.net app is having full rights. In fact i've used the same identity for app pools in IIS.
As an asp.net web application

As a console application

Any ideas?