I've installed the package on vista and all seems to be working ok from a usage perspective. However when I try to run integration tests against the SP APIs it fails on the SPSite instantiation:
System.IO.FileNotFoundException: The Web application at http://localhost/ could not be found.
This is most likely related to VS running in 32 bit mode - because when I run the same test assembly from a x64 testrunner (not inside VS) the code is able to connect to sharepoint and run tests.
Has anyone found a way to run such tests within Visual Studio?
Yes, unfortunately you can't access the OM from a 32bit process if you have the x64 version of WSS. This is because SPRequest is an unmanaged COM object and you can't mix 32 and 64 bit dll's. (So this has nothing to do with Vista)
That's why MS created the WebService in the new CTP of Windows SharePoint Services 3.0 Tools: Visual Studio 2008 Extensions,
Version 1.3 so they can bridge the x86 - x64 gap.
As I suspected then:)
Thanks for the quick reply anyway Jonas. I'll make due with the testrunner hanging around on my secondary screen and wait for MS to release a x64 Visual Studio build:)
ps: have you seen how the quickreply forum-feature behaves in firefox? window just grows and grows:)
What do you mean about the VS 2008 1.3 extensions' WebService? I am trying to test SharePoint code out of context and I'm getting the same error as described above. Is there a practical example of code "bridging the gap between 32 and 64bit? I really want to unit test my code, but this gap is hindering me.
You must host your unit tests in a 64 bit process if you are targeting a 64bit WSS/MOSS. I use NUnit and Testdriven.NET which works great!!
The WebService introduced in the latest VS extensions helps MS to "bridge the 32/64bit process gap", so they can deploy/retract + more.
It won't do you any good for unit testing.
Any quick tips on how to make nUnit run as x64? I dl'ed the nUnit package and made references in my project but I still get the SPSite constructor error. Am I skipping an important step on forcing it to be x64?
Make sure your Platform target is set to Any CPY (under Build settings).
If it is set to Any CPU try to set it to x64. You shouldn't have to but you can try it.