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'm using wspbuilder and using Return of SmartPart. Return of SmartPart need usercontrols directory in web application root folder. How can I use wspbuilder to create a package that will deploy things in usercontrols folder of web application folder root?

Thanks.

EDIT:

[02/16/2010]

@Chris

I'm a bit confused. The reference link you provided here is moving report from 12-Hive to Web Application bin folder. Correct? The example based upon on a single file what would I have to do the same to copy a folder with its content to the Web Application root? Also, the user control folder reside under TEMPLATES\CONTENTTEMPALTE\XXXXX. When the feature activate it'll copy the folder and its content from there and move it to Web Application root? Thanks.

@Anders

This seems to be useful solution. It says you build the user controls it'll wrap it up in smartpart. I'm curious how will it deploy? Can we do the web application root deployment without even do the feature writing thingy? That could be great! no plague. Please, if you've some good read on smarttemplate that shows how to create a project of it and do the deployment which copy user controls in web application root would be great! Thanks.

share|improve this question
    
Are you using SP 2007 or 2010? –  Bassel Alkhateeb Mar 19 '11 at 11:44

3 Answers 3

up vote 2 down vote accepted

The typical pattern used here is to use a timer job to make the changes in the web application root. As you've no doubt noticed, such changes are outside the scope of SharePoint's solution framework.

Here's an example of this from Gary Lapointe.

share|improve this answer
    
Thanks, Chris. I've to options: copy the usercontrols folder via batch script in setup.bat or create a feature. What would you suggest which should I pick? –  Anonymous Feb 16 '10 at 5:24
    
I'm a bit confused. The reference link you provided here is moving report from 12-Hive to Web Application bin folder. Correct? The example based upon on a single file what would I have to do the same to copy a folder with its content to the Web Application root? Also, the user control folder reside under TEMPLATES\CONTENTTEMPALTE\XXXXX. When the feature activate it'll copy the folder and its content from there and move it to Web Application root? Thanks. –  Anonymous Feb 16 '10 at 7:31
    
In Gary's code he is copying a file from the feature directory e.g. 12\TEMPLATE\FEATURES\MyFeature to the web application root. If your user controls need to run from the web application root, my suggestion would be to use the same model rather than deploy them to CONTROLTEMPLATES - otherwise it could be confusing (e.g. to other developers) as to what actually is the run-time location (since many other user controls are stored there). So when the feature activates it will deploy a timer job - when this executes, it will copy the files/folders to the web application root. –  Chris O'Brien - MVP Feb 16 '10 at 10:42
    
In my case I would have to copy a folder with its content and Gary's code has a single file mentioned in feature.xml ElementFile. What I have to do to get a whole folder moving? Thanks. –  Anonymous Feb 16 '10 at 13:18
    
You'll just need to modify the code to deal with a folder instead of a single file. See 'How to: Copy, Delete and and Move Files and Folders' on MSDN - msdn.microsoft.com/en-us/library/cc148994.aspx –  Chris O'Brien - MVP Feb 16 '10 at 15:31

Jan has made specific SmartTemplates to deploy user controls in WSP builder:

http://www.codeplex.com/smarttemplates

share|improve this answer
    
This seems to be useful solution. It says you build the user controls it'll wrap it up in smartpart. I'm curious how will it deploy? Can we do the web application root deployment without even do the feature writing thingy? That could be great! no plague. Please, if you've some good read on smarttemplate that shows how to create a project of it and do the deployment which copy user controls in web application root would be great! Thanks. –  Anonymous Feb 16 '10 at 7:30
    
sorry i dont use smartparts (the cons usually outweight the cons when it comes to debugging and deploying them) so you will have to google it –  Anders Rask Feb 17 '10 at 13:57
    
cons outweight the pros ofcourse ;-) –  Anders Rask Feb 17 '10 at 13:58

Corrected - does not answer the question

Create a root folder in your project and name it "80". All files in that folder will deployed to the wwwroot. .

If you would like to add a .dll to the wwwroot bin catalog, create a folder in your Visual Studio project called /80/bin/ and add you dll there. In your case create /80/UserControl/ and add your controls there.. You cannot create custom folders such as UserControl and add user controls. See Chris post above on how to handle files/folders not resolved by WSPBuilder and the solution manifest schema.

share|improve this answer
    
did you try this out? i dont think it will work (for the reasons Chris mention below) –  Anders Rask Feb 15 '10 at 13:52
    
Just did - and as you said WSPBuilder does not pick those(.ascx) files up - just DLLs. I'll update my answer... –  Wictor Wilen MCA MCM MVP Feb 15 '10 at 14:15

Your Answer

 
discard

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