Tuesday, September 14, 2010

SharePoint 2010 Object Model Development Tips

I learned a couple things today as I tried to create a simple Console Application. By default, the SharePoint project templates have everything preconfigured, but the out of the box defaults used by the Console Application project template will not support this.

1.) Your target framework must be .NET Framework 3.5. You can do this when you create a new project or by updating the following:
Project -> Properties -> Application -> Target framework

2.) Your debug configuration must use x64 as its active solution platform. Otherwise you're going to get a very non-intuitive message like the following:

"Retrieving the COM class factory for component with CLSID {BDEADF26-C265-11D0-BCED-00A0C90AB50F} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))."

You can change this by picking Configuration Manager from the Build menu or from the Solution Configurations drop down menu in your toolbar. Make sure the Active Solution Platform is not x86.

3 comments:

  1. That's great work around. nice done!

    ReplyDelete
  2. It turns out there is one more step when doing with an ASP.NET application. The built in Visual Studio web server (aka Cassini) does not run under 64 bit, so you need to use IIS to debug. In a nutshell, you need to create an IIS web application, then select "Use Custom Web Server" under Project --> Properties --> Web and add the Server URL here as well. Credit to Patrick's blog for providing a solution.

    File not found exception when accessing SPSite
    http://patricklamber.blogspot.com/2010/10/file-not-found-exception-when-accessing.html

    ReplyDelete
  3. Nice thought about share point,Thanks for great comprehensive and effective tips
    hire .net developers

    ReplyDelete