MOSS Forum

Ask Question   UnAnswered
Home » Forum » MOSS       RSS Feeds

2007 webpart question

  Asked By: Tanya    Date: Jul 24    Category: MOSS    Views: 643

I am trying to deploy a HelloWorld web part. I am following these


I can get it working when I code it in c#, but when I try to do this
using a .vb class library, I cannot get the web part to show up in
the gallery of available parts. I am guessing it is because the
AssemblyInfo.vb file is sitting in a different folder than it does
in the c# project. (My Projects as opposed to Properties). I thought
at first that the AssemblyInfo.vb file was not being compiled, but
the vbproj file shows that it is.

Does anyone have a step by step guide of how to deploy a vb web part
to the wss server (or know what I am doing wrong)? I saw the
channel9 Ted Pattison demo, but he is developing on the server,
while I am doing it on my local machine.



3 Answers Found

Answer #1    Answered By: Alyssa Butler     Answered On: Jul 24

I would suspect the safe control entry. If you have a root namespace and
a namespace in the VB.NET code, you must specify
RootNamespace.Namespace.Classname rather than just Namespace.Classname

Answer #2    Answered By: Katy Patton     Answered On: Jul 24

Here my code:
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.WebParts

Namespace webPartTest

Public class  testPart
Inherits System.Web.UI.WebControls.WebParts.WebPart

Protected Overrides Sub RenderContents(ByVal writer As
writer.Write("HelloWorld! You are currently logged in
as: " & Me.Context.User.Identity.Name)
End Sub
End Class

End Namespace

I have deployed the dll to the correct bin folder.
And my SafeControl entry:

<SafeControl Assembly="webPartTest" Namespace'"WebPartTest"
TypeName="*" />

I added the following code  the the AssemblyInfo.vb file:

Imports System.Security
<Assembly: AllowPartiallyTrustedCallers()>

I tried changing the web.config to full trust. I have also tried
adding the Safe="True", but it didn't do anything.

I do not know what my RootNamespace would be when you wrote:

Does anyone see anything wrong?

Answer #3    Answered By: Ana Payne     Answered On: Jul 24

Look in the project  properties for the root namespace.

Didn't find what you were looking for? Find more on 2007 webpart question Or get search suggestion and latest updates.