Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

alt text

As a console application

alt text

Any ideas?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

In most cases where I have run into that issue it was related to 32bit versus 64bit and the build settings. When I ran the code in the debugger it all worked as expected but my NUnit tests was throwing that exception. A bit of digging revealed that build settings was the culprit.

When dealing with NUnit remember this: http://www.nunit.org/index.php?p=nunit-gui&r=2.4.2

share|improve this answer
add comment

Okay. This may not be the solution. But I found that the problem is the Visual Studio 2010. If i run the same code with Visual Studio 2005 it is working great. Guess there is something going on with Visual Studio 2010 and SP 2007.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.