0

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.

1

3 Answers 3

2

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.

6
  • 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, 2010 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, 2010 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. Feb 16, 2010 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, 2010 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 Feb 16, 2010 at 15:31
2

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

http://www.codeplex.com/smarttemplates

3
  • 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, 2010 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 Feb 17, 2010 at 13:57
  • cons outweight the pros ofcourse ;-) Feb 17, 2010 at 13:58
1

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.

2
  • did you try this out? i dont think it will work (for the reasons Chris mention below) Feb 15, 2010 at 13:52
  • Just did - and as you said WSPBuilder does not pick those(.ascx) files up - just DLLs. I'll update my answer... Feb 15, 2010 at 14:15

Your Answer

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