views:

1087

answers:

2

Hi,

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?

+1  A: 

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.

Ryan
Thank you. I actually found it in `c:\program files\Microsoft SDKs\Windows\v7.0A\bin` in the end, but knowing it was not part of VS was helpful!I'm currently squirting MS Server 2008 into Virtual Box, sharepoint 2007 to follow, then hopefully I'll get to ask some actual programming questions!
MalphasWats
A: 

If you are doing SharePoint development trying to reference the Microsoft.SharePoint namespaces you need to have SharePoint installed on the machine if you want to do things like debugging, etc. For SP 2010 you CAN install SharePoint on a Win 7 machine. For previous versions of SharePoint, you will need to setup a Server that is Server 2003 or Server 2008 (you can't install SP 2007 and earlier on client machines). Generally this is a Virtual Machine for developers.

Having said all of that, there are relatively few reasons you need SharePoint to develop a WebPart. The vast majority of the WebPart functionality is part of the System.Web.UI.WebControls.WebParts namespace. Even if I am accessing SharePoint data, I generally use the ASP.NET web part.

If you are trying to use the new SharePoint VS 2010 functionality to create Visual Web Parts, etc, then you will need to install SP 2010, since that functionality is not supported in earlier version of SharePoint.

John

John Ptacek