Building ASP.NET Web Parts for Windows SharePoint Services 3.0
- Posted: May 11, 2006 at 11:22 AM
- 70,306 Views
- 26 Comments
Loading User Information from Channel 9
Something went wrong getting user information from Channel 9
Loading User Information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
Right click “Save as…”
Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation,
please create a new thread in our Forums,
or
Contact Us and let us know.
Follow the Discussion
Oops, something didn't work.
What does this mean?
Following an item on Channel 9 allows you to watch for new content and comments that you are interested in. You need to be signed in to Channel 9 to use this feature.What does this mean?
Following an item on Channel 9 allows you to watch for new content and comments that you are interested in and view them all on your notifications page.sign up for email notifications?
Very nice...
I have one question about adding web parts as safe to the web.config file...

We are using Sharepoint Portal server and I don't have a web.config located in the inpub/wwwroot directory as shown in the clip.
Where is the web.config file we need to edit for Portal Server?
Thank you in advance.
Doncho...

I am still needing the answer - you or anyone at MS care to answer? Time is of the essense...
Never mind Doncho - found it...
In our case
C:\Inetpub\wwwroot\wss\VirtualDirectories\c2170bb3-43df-46d7-9737-303d33ba0d0a
One of the virtual directories...
Works great!
Sorry I took so long to get back to you. Glad you found it.
Good demo. I have some questions about making it work for me on my system. I am running WSS 3.0 Beta 2 and the bin directory and web.config file were not located at C:\inetpub\wwwroot\. I did find the virtual directories that someone else pointed out but again no folder specifically name "bin" was there. Could the litware.dll be placed under the _app_bin directory or the App_GlobalResources directory? I modified the web config file there and created a bin folder. When I go to the Web Part Gallery and select New, I do not see the litware web part to add.
Any suggestions?
Sounds like you have done the same as I did... Not sure why it wouldn't show up...
When I create new library and put in the same code as in the video, the output library goes to my BIN folder and my we.config file has a safe entry I still cannot see the webpart from galery. In other words I can't find the galery to populate it and be able to use webpart.
Any ideas?
Hi
I had problem adding a webpart to the webpart gallery too.
I have to reboot the machine to add a webpart in the "add new webpart to a gallery" list.
I can't get a refresh if I change the webpart in VS2K5 (and re-generate it).
I don't have a intpub/wwwroot/web.config, so I modified the web.config or every virtualdirectory.
I use MOSS2007beta2 (without tech refresh) and WSS3. French version upgraded form Sharepoitn server 2k3.
any idea plz.
I've seen lots of examples on how to create a simple web part that outputs some simple text, but I've been stymied when it comes to finding any good examples of the LoadControl() technique. I've actually done this from another example I found, but I keep getting this error:
Assemblies that implement ASP.NET Web Parts and are installed into a partially trusted location, such as the bin directory, must be compiled with the AllowPartiallyTrustedCallersAttribute set for import to succeed.
Any thoughts??
thanks!
Is the link is broken or the server is too busy??
Thanks in advance, Charles.
Shola Salako.
Also, I am also getting the error message:
"must be compiled with the AllowPartiallyTrustedCallersAttribute set to succeed"
Well in my code i was attempting to access a web service in the constructor and apparently no permissions are granted at this point. Changed the code to run in the CreateChildControls and like magic it worked....
Hope this helps
Specifically I followed the instructions to have the DLL file (aka assembly) written out to c:\inetpub\wwwroot\bin. This folder is there in my machine and the build put the file there without any trouble. The correct location of the file on my machine is:
c:\inetpub\wwwroot\wss\VirtualDirectories\80\bin
Also, when it was time to edit the web.config file it was not in the folder specified in the video (c:\inetpub\wwwroot). Instead the proper folder to find the file to edit is:
C:\Inetpub\wwwroot\wss\VirtualDirectories\80
Like some others I did a search for all instances of web.config in the c:\inetpub\wwwroot path and modified multiple instances of the file. It wasn't until I put the actual DLL file in the correct bin folder that the web part actually showed up for me.
c:\inetpub\wwwroot\wss\VirtualDirectories\80\bin
While I was frustrated by the fact that my web part wasn't working when trying to follow along with an extremely elementary exercise, I have to (grudgingly) admit that I learned more about the whole process by having to repeat the steps multiple time and beat my head against the wall in frustration.
Thank you for this basic walk through. It worked like a charm! I would like to use SQL and AD data in the webpart and haven't found any med-advanced code snippits on how to accomplish this. Do you have any suggestions on where to look?
Thanks,
Shawn.
the w3b1d10t.
I too faced the same error.

Assemblies that implement Asp.Nety Web Parts and are installed into a partialy trusted location, such as the bin directory, must be compiled with the AllowPartiallyTrustedAttribute set for import to succeed"
But the good thing is, I was able to resolve the error.
While creating the project VS 2005 added a signature file <filename>.snk file.
Please delete the <*.snk> file from the project and rebuild the project. Then put the DLL in the bin directory of the web site......
Now you should be able to add the web part to the SharePoint site.
Hope this helps you...
I faced the same problem. Did everything everybody else previously mentioned.
How I solved it. I created a web part project under VS2005 with WSS extensions installed. Then built the project (and this is the important bit) and deployed it using VS2005's Build>Deploy <Project> menu. VS2005 did its magic and got it working.
BTW, deleting the Temporary.snk file did not work for me.
Thanks.
Doing what wym.inc did (VS2005 Build->Deploy menu) worked for me as well. Din't try the other possibilities.
I am quite new to Sharepoint and ASP .NET technologies so I appologize if my question is too simple.
This tutorial is great but I can't imagine creating all controls by writing the code manually.
Is this possible to create eg. new ASP .NET web appliaction in Visual Studio 2008... create a Web Part using Web Parts Toolbox and other controls in "visual" mode and then populate it somehow to the sharepoint site? Just like dll's ?
Thanks in advance for the response.
Best regards.
thanks for the video..i am quiet new to sharepoint and so i just followed the video to create my wep parts..however when i try to deploy my web parts i got this message and error:
"Load of property 'OutputPath' failed. The entered path is not a valid output path"
"System.NullReferenceException: object reference not set to an instance of an object."
i have set my output path to the bin folder..and also i have tried the suggestions written here..but still having the same error..
any suggestion is welcomed!
thanks
good example.thanks
Remove this comment
Remove this thread
close