views:

1213

answers:

4

I want to develop a public website on SharePoint server 2007.

But, I want to develop a solution using Visual Studio 2008 (I dont want to use SharePoint designer 2007).

A: 

Take a look here: Walkthrough: Creating a Basic SharePoint Web Part.

I strongly recommend to take a look into Visual Studio 2008 extensions for Windows SharePoint Services 3.0, v1.3 - Mar 2009 CTP

Rubens Farias
I already have website running on my local server and I can edit or Add new html pages using SharePoint designer.But, I want to do it using Visual Studio 2008 (Like adding html or .aspx pages on my website.)
imsatasia
A: 

Depending on the environment that you are using there are multiple strategies to setup your machine for Sharepoint Development.

If you are using an operating system such as Windows XP, Vista, or 7 you will not be able to install either Sharepoint 2007, Windows Sharepoint Services, or Visual Studio 2008 Extensions, since they all require a server operating system - Sharepoint 2010 will allow you to install on Vista or 7 (x64) though. The Sharepoint assemblies are installed on the machine when you install Sharepoint. Your options here are either:

  1. Use Virtual PC to create a virtual Windows 2003 instance, which you will use for your development. You will install Sharepoint 2007, Sharepoint Services, Visual Studio 2008, and Visual Studio 2008 Extensions for Sharepoint. You will use this virtual instance for your development and testing before deploying to your testing server then production.

  2. If you don't want to do virtualization then you can just use Windows 2003 as your main operating system and follow the same steps above.

  3. If you want to stick with XP, Vista, or 7 without virtualization then you can copy the necessary assemblies from your Sharepoint server to your local machine. You can't use the Visual Studio Extensions, but you will still be able to develop for Sharepoint with the assemblies. This solution will make it a little more difficult to debug though, because you will need to deploy your code to a test Sharepoint server to do it.

EDIT

Visual Studio on its own can't open Sharepoint sites, because it wasn't designed to edit Sharepoint sites. You would use Visual Studio to create web parts, workflows, etc... Sharepoint Designer on the other hand was designed for editing pages and I would recommend using it for site edits.

BUT, if you would still rather use Visual Studio, then you can use the following Visual Studio Add-In to open your Sharepoint site in Visual Studio:

http://spdevexplorer.codeplex.com/

I personally haven't used it, so I can't be certain of how good it is.

Hope this helps.

Waleed Al-Balooshi
I'm using Windows Server 2008 (x64) and SharePoint Server 2007.and I've installed "Windows SharePoint Services 3.0 Tools: Visual Studio 2008 Extensions, Version 1.2".Now I can see Project Type "SharePoint" when I create new project in Visual Studio 2008.But, my question is how to get my SharePoint website stuff in visual studio.??Do I need to use "Team Site Definition", "Blank Site Definition" etc..???
imsatasia
@imsatasia I have edited my response to answer your question.
Waleed Al-Balooshi
I have used this("http://spdevexplorer.codeplex.com/") in VS 2008.Its like explorer and I can edit in my Webpage. But, I can't add New Web Page using that explorer.------------------->I want to develop a pure HTML(using css, jquery, javascript) file on SharePoint server 2007. If I want to add webpage(html) can I do it using VS 2008 or Do I need SharePoint Designer for that.?
imsatasia
@imsatasia I use Sharepoint Designer for that task. But, looking at the following page, http://weblogs.asp.net/soever/archive/2009/05/25/spdevexplorer-2-3-edit-sharepoint-content-from-within-visual-studio-4.aspx it seems like you should be able to add new files to sharepoint using SPdevExplorer - at least it seems like you can do it from the screenshots of the 2.3 release.
Waleed Al-Balooshi
+1  A: 

You don't absolutely need to have Visual Studio to create a SharePoint 2007 site. You can definitely get away with using notepad if your web site doesn't been compiled code. You may have some requirements that require some custom code. It all comes down to your requirements. I try to avoid using Visual Studio for writing features. Even some basic webpart can be written without using any code behind and using out of the box SharePoint controls.

Visual Studio is very handy for source control (connectivity with TFS) and generally structuring your solution to match the requirements of the WSP file. Of course you should use Visual Studio to compile your assemblies. :) The general set up would be Visual Studio with WSP Builder extension installed (look on codeplex ). If then you create the correct folder structure inside your VS project, the generation of your WSP will become much easier. Having said this, you can create wsp files (which is just a renamed cab file) using WSP Builder.

Once you've created your WSP, you can deploy this via stsadm commands (google this). I would suggest having a batch file as a deployment script.

This might help with your initial setup: http://blog.zebsadiq.com/post/SharePoint-2007-installation-in-2010.aspx

p.s. Definitely avoid making any changes through SharePoint designer, you should learn about the consequences before you change any files on your site with it.

Forgot to mention: SharePoint desginer is great for formulating web part html. If you're new, you probably wondering a) where do I find the syntax for a basic out of the box web part b) How do I tweak that syntax to get the results that I need... Best way to do this would be to connect to the site, create a dummy page, add the web part to the page (drag and drop) and tweak it via the SharePoint Designer UI, then once you're satisfied, switch to html view, copy the web part syntax and paste it into the file on the file system. You can then delete the dummy page if you want or use it for configuring other web parts. The point is, though SharePoint designer has its flaws and you may be right to avoid it as your main method of development, its definitely got some features that make it worth while having available while developing.

Zeb
+1  A: 

You are missing some fundamentals of how SharePoint development and deployment differs from ASP.NET. You create SharePoint Solution Packages in (.WSP) in Visual Studio and deploy them to the server using the STSADM tool. Alternately you can deploy web parts to the BIN using more traditional techniques of copying the files and modifying the web.comfig on the server but in the long run it is worth your time to understand how to create solution packages.

Here is an article and video to get you started: http://msdn.microsoft.com/en-us/library/bb466225.aspx

The author of the article Ted Pattison is the author of a book called "Inside Windows SharePoint Services 3.0". It is considered one of top books for SharePoint development and you can usually find it used online very cheap, I would highly reccomend picking up a copy.

He is also the author of the excellent deployment tool STSDev which can be found on CodePlex. I would suggest taking some time to understand the deployment process before using tools like STSDev, WSPBuilder or SPVisualDev, because while the tools are good, and relieve much of the tedious stuff involved with SP development, they do not handle all scenarios and eventually you will find yourself needing the fundamentals to create flexibility the tools don't provide.

Cheers, CJ

Junx