How to get MOSS 2007 dev. environment set up in Vista with sample project. 1. Download MOSS 2007 SP1 setup file from Microsoft. Or use the OfficeServerwithSP1.exe file in the installers folder. 2. Download the WssForVista.Install.zip from http://community.bamboosolutions.com/blogs/bambooteamblog/archive/2008/05/21/how-toinstall-windows-sharepoint-services-3-0-sp1-on-vista-x64-x86.aspx 3. Run the setup.exe file from the zip file downloaded in Step 2. 4. Then run the SetupLauncher.exe from C:\Program Files\WssOnVista\Setup\ 5. It will ask for the location of SharePoint installer. So point it to the setup file downloaded in Step 1. 6. Use the following key when prompted: Key: F6YVR-4XY7K-RCVY4-37FBK-G44PY
7. If everything goes well, you should see this
8. The wizard should then launch the SharePoint Products and Technologies Configuration wizard. 9.
10. Select No, I want to create a new server farm.
11. And then this might happen! That is, a utility with an awesome name, that you ve never heard of before and have no clue about what it does, would stop working. So what do you do? You click Close program and continue.
12. Crap! Then this also might happen. That is, a Visual C# Command Compiler, this one you have heard of before, of course, would stop working. So what do you do this time? Same as last time - You click Close program and continue.
But this time, you are out of luck. The configuration fails and politely lets you know that as shown below. Remember the installation was successful. It is the configuration that failed.
Alright.now what? Now nothing. Just run the configuration wizard again from your Start menu.
Follow the same steps as did earlier in the first attempt, until you hit the point where it tells you the sharepoint_config db already exists. Whaa??? It turns out that when configuration fails, it doesn t roll back the db stuff. So you ll have to delete sharepoint_config db and the other weird looking db before you run this wizard again.
And hit next and you are done! TA DA!
You click finish and it will take you to the SharePoint Central Administration url i.e. http://<your_computer_name>:<whatever_port_number_was_assigned during_sharepoint_installation> In my case, it is http://trifectra:8361/ You will be prompted to login against Active Directory.
On successful login, here s what you ll see. And you are done! YAY!!!
Visual Studio 2008 Set up 1. Download and install VS 2008 extensions for WSS 3.0 from Microsoft - http://www.microsoft.com/downloads/details.aspx?familyid=7bf65b28-06e2-4e87-9bad- 086e32185e68&DisplayLang=en or use VSeWSSv12.exe in the Installers\ WSS 3.0 Extensions for VS 2008 folder. 2. Take a look at what MS has to say about these extensions. I have highlighted the important section that we care about.
3. Run the installer and here we go.
WSPBuilder VS 2008 Add-in 1. Download and install WSPBuilder Visual Studio 2008 Add-in from here - http://www.codeplex.com/wspbuilder or run the setup.exe from the Installers\ WSPBuilder Extensions 1.0.3 folder.
2. Now before we start coding, we need to create a new web application and a new site under this web application, that will use the web part we are about to write. Let s do that now. So go to Sharepoint Central Administration url on your browser. For example, http://trifectra:8361 or from the start menu short cut as shown below.
Here are some sample fields and their corresponding sample values you could set. IIS Website Description = http://wspbuilderproject2 DB name: wss_content_wspbuilderproject2 Application Pool: Wspbuilderproject280 Use a domain account to run the application pool and not the network service (ran into issues with network service. Can t remember what though. Sorry yeah but don t use it. )
After creating the web application, open up the hosts file (in C:\Windows\System32\drivers\etc) and add an entry for this new web application. For example, 127.0.0.1 wspbuilderproject2
And then create a site under this new Web application.
Set the title of the site to your project name for now. Under Template Selection section, I used the collaboration template in Publishing tab as show below. (No special reason)
And you are done! (Well not really you are now ready to build a web part is what I meant by done)
Sample web part project 1. Use WSPBuilder s project template in VS 2008 to create a new SharePoint feature project.
Now right click on the project in the solution explorer and Add a new web part *without feature*
Now open up the WebPart1.cs class under the WebPartCode folder. The code in the class is pretty straightforward and self explanatory. All it does is add a LiteralControl that displays Hello Sharepoint on the page.
Now let s try to build and deploy this little Hello Sharepoint web part in our new SharePoint site. So right click on the project in Solution Explorer and click on WSPBuilder and click Build WSP.
If it works well, then you should see the Done! message as shown below.
Now click Show All Files in Solution Explorer
And you should see the wsp file as shown below. Include that in the project. (Not necessary but good practice).
Now right click on the project and click WSPBuilder and Click Deploy.
If it deployed it successfully, you should see this.
Now let s go see if this webpart1 exists in our SharePoint portal. Go to the site url. Login. In my case, http://wspbuilderproject2/
Click Edit Page and On the right side bar, Click Add Web Part Zone.
Select the web part we just added in the pop up window under All Web Parts section.
Click Publish and you are done! Congratulations! Your web part is now a part of the site. Now let s make a change to this hello sharepoint web part and try to deploy it again (this time using the upgrade option in WSPBuilder context menu. Change the text from hello sharepoint to hello sharepoint. I am your father.
Now right click on the project and click WSPBuilder and Click Upgrade. It should compile the project first, build the wsp and deploy the upgraded solution file.
Yes.
Now let s go check if the Webpart hello sharepoint now says hello sharepoint. I am your father. Go to the page. And hit refresh.
Sweet! Now one last thing before we wrap up. If you want to be able to debug and step into the code, attach the IIS worker process to the IDE *using the Attach to IIS worker processes feature in WSPBuilder s menu* as shown below and not using the Visual Studio s Attach Process feature (doesn t work because it can t find the symbols (PDB files) for the DLLs. You can copy the PDBs from the Debug folder and put in the GAC_MSIL ( in the same folder as the DLLs that just got deployed), it still won t work. It says PDB image does not match the DLL or something like that)
Set a breakpoint somewhere in the code. Ctrl + Alt + U to see the modules loaded after you attach the process. And you can see that the DLLs have been loaded and the PDBs attached. Now go to the page that has the web part, hit refresh and bingo! Your breakpoint has been hit!
And with that, I conclude this tutorial. Hope this helps.