Building webparts with Visual Studio 2010 Express - visual-studio

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?

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.

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

Related

Sharepoint 2013 Farm Visual Studio cannot connect

I have Visual Studio Ultimate 2013 and SharePoint Designer installed on my local machine. I have a SharePoint installed on a server farm that i have full read and write permissions on. My problem is when i try to create the project the wizard to connect to the SharePoint will not show up and it says i need it installed on my local machine. I have read many forums posts such as
https://social.msdn.microsoft.com/Forums/en-US/5853a07e-e033-43ab-929b-f5766354fea9/cannot-connect-to-sharepoint-2013-farm-with-office-tools-for-visual-studio-2012?forum=sharepointdevelopment
https://msdn.microsoft.com/en-us/library/office/jj220047(v=office.15).aspx
along with others these are just the ones still open in my browser. I would love some help or a proper tutorial because the ones i am finding are no help and im not seeing anything besides a error message saying i cannot create a project until i install foundation or server for sharepoint
This is a case where the error message means exactly what it says. You must install SharePoint on your development machine in order to use Visual Studio for local SharePoint development. You can develop on Windows Server 2008/2013 (most common solution I've seen), install SharePoint on your Windows 7/8 machine (which is painful to do but possible), or set up a remote environment for development after signing up for an Office 365 Developer Site.
After hours of searching I found a work around for anyone who is running into this problem... You need to make a web reference to the SharePoint site then you can access the XML and do it that way. Microsoft hides the option its under service reference then you click web reference add the URL and a easily called name add it and your good to go.

Visual Studio 2010 and Clickonce: old .NET and office prerequisites

I am currently preparing an application in Visual Basic, mostly targeted on systems with .NET 2 installed and office 2003.
Moreover, as the systems are corporate ones, they need administrstion rights, so I had in mind an app that does not need to install anything (or register).
The application uses an external ocx, an axwebbrowser ocx and an excel interop.
The first problem stands because a user cannot run the application as it crashes, seeming because cannot find on his system ahdocvw.dll. is there a way to install for example a redistr package that includes the axwebbrowser system xomponent? At least to append it on the clickonce setup.
Second, in case that the user does not have the required framework, I would like to add on the Clickonce prerequisite box, the option for .NET 2 and office 2003. Right now, VS 2010 has only available .NET 3.5+ and Office Pia 2007.... could you suggest to me on how to proceed?

Multiple users using single installation of Visual Studio

We are a group of four students who have to develop SharePoint web parts for a certain project. After two weeks of trying out various options, the only possible way we could do it was to set up a Windows Server 2008 R2 64-bit virtual machine (using VMware Player) on a Windows 7 Professional 64-bit desktop with an i3 540 (because it supports VT, unlike the laptops we four have), make four user accounts on the VM OS, and remote desktop into it from our laptops to develop. The VM has Visual Studio 2010 Ultimate, SharePoint Foundation 2010 and SharePoint SDKs installed.
My question is; if we create four different projects in Visual Studio, can we concurrently use that single installation of Visual Studio from remote desktop to work on our individual projects?
If yes, what kind of problems should we expect and how can we ensure we don't run into them?
Alternatively, is there another more trouble-free way of working this out (like changing some setting in Visual Studio to allow multiple instances, etc.)?
Thanks!
While this should work without issues, I would take care with an issue like this.
I would first verify that this is allowed under your current licensing for Visual Studio. I suspect that this is likely a violation of the license agreement, and as such, I would take care with trying to find a better solution. It may be allowed under your license (as there are many different forms of licensing), but I would check this very carefully prior to operating in this manner.
That being said, I suspect this will work fine. Visual Studio does take care to work and store settings per user account, so there is likely no issue. Microsoft Support would be the proper channel for support if you do run into any problems while operating, however.
If your laptops are 64-bit, I would install Visual Studio 2010 and SharePoint 2010 on each of your laptops. If your laptops are 32-bit, I would create 4 separate virtual servers.
Beyond the licensing that Reed points out, I would be concerned about resource sharing. During a SharePoint 2007 project, we had 3 developers sharing a single SharePoint virtual server with Visual Studio 2008 installed on each of our laptops. Everything went fine for awhile until development got really heavy. As soon as one developer would finish running a deployment job, another would start one. The application pool was down so often that the web sites were unusable. Everything was fine once we each got our own virtual server.
If you really must use one server (not recommended), then i would suggest you create 4 seperate web applications. This means they will each get a seperate application pool. Then each users should still be able to debug their webparts without effecting the other users. The debugger should only "break" the application pool that the user is on.

Installing Team Foundation Server (Migrate from StarTeam)

We are currently using StarTeam as our source control, but I am looking into alternatives. We are licensed for Team Foundation Server so I am thinking of using that as I believe it can integrate with VB6 and VS2010 Prof? (StarTeam doesn't integrate with either - at least the version we have doesn't)
Looking briefly at the features of TFS it seems there is a lot in there. To start with I just want SourceCode control. Does anyone know of a good step by step idiot's guide to setting this up? What needs to be installed where, what needs to be backed up etc, etc?
Also do I need to install anything else on my client to get VS2010 to work with it?
I don't really care about migrating the data from StarTeam but if anyone knows how this can be done I would be interested!
For your Visual Studio clients, you'll have to install Team Explorer - there's an installer on the TFS media, or you can download it separately. Each Visual Studio has to have a matching Team Explorer version installed (so if you have VS2008, you'll have to install Team Explorer for 2008), but to access later TFS servers, you generally have to install an extra update. For VB 6 (or VS2003), you'll have to use the TFS MSSCCI provider.
As to installing the server, all I'd recommend is install it somewhere first and play around with it before you install it for production use - get some familiarity with it. The install process is relatively straightforward.

How to set up a SharePoint 2010 developer machine?

As the release date for the public beta of SharePoint 2010 is coming closer and closer, I'm wondering how to set up a developer machine for it. I've heard that for developing on SharePoint a 64 bit system is needed and that Microsoft advises to use Windows 7 64 bit and install SharePoint 2010 on it.
I think that won't be an option for me as I only have one computer here at work and I don't like to install SharePoint on the same machine that I use for my normal office work (email stuff, writing concept papers, ...).
Am I right that I only have two other options? Using Server 2008 as a desktop operating system and install SharePoint 2010 on a virtual machine or using Windows 7 64 and use VMWare to host the SharePoitn 2010.
So I'm wondering if there are any other options and which one you chose? What experiences have you already made?
If you decide to install 2010 on your Vista/Windows 7 machine, make sure you have at least 4GB of RAM (I'd personally want at least 6, if not 8), and follow the instructions from MSDN: "Setting Up the Development Environment for SharePoint Server"
Yes, you are right there are only three options:
Install SharePoint onto the OS natively (new for 2010 and aimed at developers)
Install SharePoint into a VM you run on your machine
Get a second machine and install SharePoint on it.
In addition you will need Visual Studio 2010 for the developer experience to be complete.
I would highly recommend trying the install native route as it will provide a great development experience and will run fairly light. Also at worst you can have two batch files, one of which starts and the other stops the services so there will be zero impact except disk.
I am doing some SP2010 development at the moment. I have:
Windows Server 2008 R2 Standard with Sharepoint 2010 and Visual Studio 2010 installed, running on Hyper-V. I just connect to it via Remote Desktop. Works a treat. I do all my dev in the VS2010 instance running on the VM, leaving my physical work computer free for everything else. I back up my work using TFS, so if I mess up the Sharepoint install (somehow), I can just roll back to a previous snapshot.
hope that helps. :D
Sharepoint 2010 development takes a lot of hardware resources. You can't use Hyper-V on Windows 7 but if you have the Enterprise version of the OS, you can build and boot directly from VHD, taking normal advantage of hardware resources. To learn how, you can visit this post: http://rambletech.wordpress.com/2011/09/19/boot-windows-7-directly-from-virtual-hard-disk-image/
HTH.

Resources