Creating a publish folder for web applications is easy, you don’t have to do anything for that, web application project template does it for you. When you working with solutions for more than one project you have deal with different deployable units/packages. I was working on a build script that we need to run in our continuous integration process. But creating separate packages for each project was painful is you want to do it manually, and I tried to understand how web application projects template works and came up with this solution.
CopyToPublishedApplications msbuild file inspired by Microsoft web application projects build process file “Microsoft.WebApplication.targets”.
It creates _PublishedApplications\yourappname folder in your output directory.
By using this msbuild file you don’t have to deal with seperation of files based on projects when you are building solutions with multiple projects.
msbuild file and sample project is located in my github account. please follow the link : https://github.com/hancengiz/misc/tree/master/CopyToPublishedApplications
<Import Project=”….\CopyToPublishedApplications.msbuild” />
msbuild yoursolutionfile.sln /p:OutputPath=C:\yourcioutputfolder /p:CopyToPublishedApplications=true
dir output /s /b
\sampleproject\output\ClassLibrary1.dll
\sampleproject\output\ClassLibrary1.pdb
\sampleproject\output\WindowsFormsApplication1.exe
\sampleproject\output\WindowsFormsApplication1.exe.config
\sampleproject\output\WindowsFormsApplication1.pdb
\sampleproject\output\WindowsFormsApplication2.exe
\sampleproject\output\WindowsFormsApplication2.exe.config
\sampleproject\output\WindowsFormsApplication2.pdb
\sampleproject\output\ _PublishedApplications
\sampleproject\output\ _PublishedApplications\ClassLibrary1
\sampleproject\output\ _PublishedApplications\WindowsFormsApplication1
\sampleproject\output\ _PublishedApplications\WindowsFormsApplication2
\sampleproject\output\ _PublishedApplications\ClassLibrary1\ClassLibrary1.dll
\sampleproject\output\ _PublishedApplications\ClassLibrary1\ClassLibrary1.pdb
\sampleproject\output\ _PublishedApplications\WindowsFormsApplication1\ClassLibrary1.dll
\sampleproject\output\ _PublishedApplications\WindowsFormsApplication1\ClassLibrary1.pdb
\sampleproject\output\ _PublishedApplications\WindowsFormsApplication1\WindowsFormsApplication1.exe
\sampleproject\output\ _PublishedApplications\WindowsFormsApplication1\WindowsFormsApplication1.exe.config
\sampleproject\output\ _PublishedApplications\WindowsFormsApplication1\WindowsFormsApplication1.pdb
\sampleproject\output\ _PublishedApplications\WindowsFormsApplication2\WindowsFormsApplication2.exe
\sampleproject\output\ _PublishedApplications\WindowsFormsApplication2\WindowsFormsApplication2.exe.config
\sampleproject\output\ _PublishedApplications\WindowsFormsApplication2\WindowsFormsApplication2.pdb
1 Response to Create an output folder for each project in your solution, like _PublishedWebsites for web applications.
cengizhan2forum
January 15th, 2012 at 1:46 pm
güzel bir makale olmuş çok teşekkürler.