Building webparts with Visual Studio 2010 Express

MalphasWats picture MalphasWats · May 17, 2010 · Viewed 12.8k times · Source

I'm trying to get started with building my own webparts, planning to follow this MSDN article.

I've downloaded Visual C# 2010 Express - I'm not quite at the point where I feel comfortable dropping 1000 big ones yet, and I installed Visual Web Developer 2010 Express via the WPInstaller.

Following through the tutorial, aside from the fact that I don't get the option to create a "Web Control Library", a gap I filled with this article, I can't seem to find the sn.exe tool (or the "Visual Studio 2005 Command Prompt"!).

I know it's not quite a direct programming related question, but I can't even get the thing going yet!

Any help is appreciated. Thanks

EDIT:-

I think I may be jumping the gun quite considerably, I wrote a simple hello world example and tried to build it but it doesn't have any references to the Microsoft.SharePoint packages and they don't appear in my lists.

Am I understanding some more research I've done (namely this) correctly, in that I have to actually have a full installation of actual SharePoint on the machine I'm developing on?

Answer

Ryan picture Ryan · May 17, 2010

sn.exe is part of the .Net Framework SDK tools - not actually part of Visual Studio.

If you've got the SDK installed (which I think you must have if you're using VS) then it will be in a directory such as (depending on which version of .NET SDK you've got installed)

c:\program files\microsoft.net\SDK\v2.0\Bin

You can develop SharePoint web parts with VS express but you won't be able to use extensions like VSeWSS which can make your life a little easier.

You don't have develop on a machine with SharePoint installed upon - you can just copy the Microsoft.SharePoint.dll assembly from a machine with it installed on and reference it in your project.

There are pros and cons to developing on a SharePoint machine.

  • Its easier to get started - especially debugging locally rather than remote debugging.
  • Harder to be sure that you're code will work a 'real server' - are you sure you don't have any dependencies that may not be installed.
  • Harder to work with multiple versions of SharePoint (2007 WSS and MOSS and 2010 foundation, server etc).

If you do want to work with a locally installed SharePoint then

  • You can install windows server OS with SharePoint and Visual Studio.
  • there is a hack for installing SharePoint 2007 on vista (referenced in the SO article you link to)
  • you can install SharePoint Foundation 2010 on Windows 7 (but I am not sure what the licensing restrictions are - is this maybe something thats given through MSDN?)

If you decide to go with the remote server installation then save yourself some grief and use virtualization such as VMWare Server, Virtual PC or Hyper-V.