At the moment we have all our Sitecore rendering XSLTs and user controls in our web application project. We would like to move them to their own project, but have everything otherwise work the same.
Is that possible?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is the method I use to do this, please note that it does take modifications to your csproj file to make sure that the files are placed in the appropriate directories on a build. I have based this on SharedSource examples, for instance, the Partial Language Fallback module in the Language Fallback project room in Shared Source uses this technique.
In your project dir, create a file called
deploydirectory.txtand put the path of your final web location.In your new project’s csproj file, add this code block just before the
</project>(assuming no other custom changes have been made in here)This code block as it currently stands, copies all files in app_config, all dll files in bin, and all ascx files in the layout directory and sub directories into the path in your deploydirectory.txt file. The
**defines that they will be placed into the appropriate sub directories at the target.This is currently set to exclude any .svn directories found.
Finally, this only runs if you have the file deploydirectory.txt in the project directory, otherwise it ignores this directive completely.
EDIT: if you want, you can also include the list of directories/files to move in a separate file so that you don’t need to modify the csproj file every time you add more files that you need to move across (say you start with usercontrols, and then add xslt renderings later etc)
Where
SourceFilePaths.txtcontains the following