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): 38442/ 62

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

User Comments

Title: There is no Web.confg file   
Name: Steven Barden
Date: 2010-03-05 6:05:31 AM
Comment:
The reason there is no Web.config is because this project is not a web project. It is a web-based component that will be added into SharePoint, which is a web-application and will have it's own web.config. That said, you will have to register your web componenet with the web you want to show it from... actually with the site collection. (site collections and webs are another topic). So think of your web-part as being a specialized user-conrol. The user-control can be developed alone, then added to a web-project. That is the case here as well. I hope this helps.
Title: There is no Web.confg file   
Name: HelloWorld
Date: 2010-03-05 5:57:16 AM
Comment:
There is no Web.config file in my VS.
What to do next?
Title: Great   
Name: GRF
Date: 2009-09-03 4:43:03 AM
Comment:
Your tutorial opens me a new world!
Title: Outstanding   
Name: kp
Date: 2009-03-03 6:44:40 AM
Comment:
Really clear and good
Title: Outstanding!   
Name: kp
Date: 2008-11-17 5:12:53 AM
Comment:
Really clear and good
Title: really good   
Name: Tom Morris
Date: 2008-09-23 5:56:39 AM
Comment:
Really good introducing!thx
Title: AWESOME   
Name: M.Czarnecki
Date: 2007-11-02 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 





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


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-03-29 3:48:53 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search