0

I developed a test web part and everything worked well. Now I try to deploy another webpart without using GAC (several websites, including Microsoft's, say that the web part dll must either be in /bin folder or in the GAC).

Now, when I copy the dll of the webpart into the /bin folder, it is not shown in the available webparts in SharePoint 2010.

A restart of the server didnt work, nor adding it to the web.config.

How can the webpart be registered to SharePoint?

2 Answers 2

1

In the Feature properties within your project there is a setting for DeploymentTarget which can be set to GAC or Bin.

2
  • in VS2010 you have to change in your 'solution -> Package -> Package.package -> Package.Template.xml' the attribute DeploymentTarget to 'WebApplication'. Thank you!
    – Anonymous
    Commented Sep 29, 2010 at 14:50
  • Ah yes, Package, not Feature, that's where I was meaning though :)
    – James Love
    Commented Sep 29, 2010 at 14:54
0

It is not a good idea to manually deploy customizations by copying the files to a folder. The dll is part of it, but there are also Safe Control entries that are made to the web.config, and the definition of the web part in the .webpart file. This is what gets added to the Web Part catalog and links to the deployed dll.

At deployment time, when you run the deploy solution command you can exclude the "-allowgacdeployment" input to put it in the bin.

3
  • Thanks for your awnser, but how/where can i force VS 2010 to deploy it to the /bin folder instead of the gac?? I dont run a deployment command, i only click on deploy in VS2010.
    – Anonymous
    Commented Sep 29, 2010 at 14:01
  • You will also want to be familiar with the stsadm commands since that is how it will be deployed to other environments. Commented Sep 29, 2010 at 14:24
  • 1
    Powershell commands in the 2010 world! Better learn them now as stsadm will be gone in the next version (not official, but its highly likely) Commented Sep 29, 2010 at 21:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.