Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers 2

up vote 1 down vote accepted

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

share|improve this answer
    
in VS2010 you have to change in your 'solution -> Package -> Package.package -> Package.Template.xml' the attribute DeploymentTarget to 'WebApplication'. Thank you! –  Anonymous Sep 29 '10 at 14:50
    
Ah yes, Package, not Feature, that's where I was meaning though :) –  James Love Sep 29 '10 at 14:54
add comment

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.

share|improve this answer
    
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 Sep 29 '10 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. –  Mike Oryszak Sep 29 '10 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) –  Charles Lee Sep 29 '10 at 21:33
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.