views:

276

answers:

2

Now i am using the sharepoint extensions 1.2 for Visual Studio 2005 to deploy my website. I want to add an assembly to the bin, but i don't know how to add it to the Team Definition.

Could someone give some code, plz?

A: 

If there's any SharePoint-relevant code (web part, event receiver etc) in your project, the assembly will be packaged up in the resulting WSP and your solution manifest will already have an instruction to put it into the GAC. Any particular reason you need it in the bin rather than the GAC? It can be done -- read up the documentation on the Solution Manifest XML format -- but requires manipulating the solution manifest from WSP View manually, and might require re-creating the WSP with WspBuilder.

ROXORITY SharePoint Web Parts
Well the GAC is ok, but i have included one reference to the team definition and it hasn't deployed not in the bin not in the GAC, must i have to create any xml?
netadictos
A: 

OK I found a solution.

First you have to add the assembly you want to deploy into the VS project. For example you can create a "libs" folder to store all external assemblies you'll need in your team site.

Then you have to edit the manifest.xml file of your Team Site Definition. You can find this file within the "pkg" folder within your project. Be aware that the pkg folder will only be available if you've at least deployed the solution one time.

OK, now you have to add a new <Assembly> child element to the <Assemblies> element within the manifest.xml file of your Team Definition solution. With the "DeploymentTarget" Attribute you can define whether the assembly should be deployed to the GAC or to the web application's bin folder.

The following example shows how the <Assemblies> element looks like if you want to add the "TeamSiteDefinition1.dll" to the GAC and to add the "TestSolution.dll" to the bin folder. If you need a safe control entry for your assembly you can add this one too.

<Assemblies>
    <Assembly Location="TeamSiteDefinition1.dll" DeploymentTarget="GlobalAssemblyCache" />
    <Assembly Location="TestSolution.dll" DeploymentTarget="WebApplication">
       <SafeControls>
          <SafeControl ..... />
       </SafeControls>
    </Assembly>
</Assemblies>
Flo
Thanks. There is another option, if you go to the tools bar of Visual Studio, in view, other panels, you can find wsp view, and you access the manifest from there.
netadictos
Ah OK, good to know.
Flo