Building a Hello World Web Part for Windows SharePoint Services 3.0
page 6 of 9
by Steven Barden
Feedback
Average Rating: 
Views (Total / Last 10 Days): 14666/ 235

Part 3: Deploying The Manual Way

There are multiple ways that you can deploy this Web Part; for example, you could add a strong name and deploy to the GAC. Or you can deploy it to the bin directory of the website you are using, which is the option this article uses.

1.    Right mouse the project in the solution explorer.

2.    Select properties.

3.    Select the Build tab.

4.    Change the output path to the bin directory of the site you are deploying to. If the bin directory does not exist you can create a new one. As indicated previously, we do not need to develop this webpart on the development server. So one example you can use as your output path is seen below. The good part of this means you can develop simple webparts on any version of Windows using Visual Studio 2005, then deploy to your intended location:

\\<servername>\c$\Inetpub\<sharepoint-root>\bin.

5.    Now build your project using <Control><Shift><B> or from the menu options.

6.    Now you need to build a safe entry in the Web.config. Open the Web.config file with Visual Studio.

7.    Locate a safe control entry, such as the line with Microsoft.Office.Excel.WebUI, and make a copy below the original line.

8.    Notice that all of Microsoft’s lines use a four part strong name. This example does not need a four part name since we are not using strong names. You can use just the Assembly name without the .dll extension, in this case "HelloWorldWebPart."

9.     Next, replace the namespace, in this case "HelloWorldWebPart."

10.  Finally, fill in the type name. You can add any of the methods you have written that you want to deem safe to expose or use "*" for all methods.

Listing 3

<SafeControl Assembly="HelloWorldWebPart" 
    Namespace="HelloWorldWebPart" TypeName="*" />

11. The act of saving the Web.config file is enough to reset the application, so there is no need to perform an iisreset. The site will automatically recycle to get the changes.


View Entire Article

Article Feedback

Title:  
Name:  
Url: ( Optional )
Comment:  
Please add 8 and 5 and type the answer here:

User Comments

Title: Outstanding!   
Name: kp
Date: 11/17/2008 5:12:53 AM
Comment:
Really clear and good
Title: really good   
Name: Tom Morris
Date: 9/23/2008 5:56:39 AM
Comment:
Really good introducing!thx
Title: AWESOME   
Name: M.Czarnecki
Date: 11/2/2007 2:43:03 PM
Comment:
Absolutely fantastic.
You really reamoved all the bloat and the ridiculous hoops that MS wants us to go through. I don't have time for all that garbage. Your tutorial is a gem.

Product Spotlight
Product Spotlight 
Learn More
.NET Tools
asp.net shopping cart
asp.net chart control






Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2009 ASPAlliance.com  |  Page Processed at 1/9/2009 6:57:39 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search