I have a solution with 3 projects in it. I need to copy a view from one project to another. I'm able to copy the created DLL via post build events like so:
So i want to copy the file in project one '/Views/ModuleHome/Index.cshtml' to a folder in project 2. How do I copy file(s) to my desired project via post-build event? Thanks
xcopy "$(ProjectDir)Views\Home\Index.cshtml" "$(SolutionDir)MEFMVCPOC\Views\Home"
and if you want to copy entire folders:
xcopy /E /Y "$(ProjectDir)Views" "$(SolutionDir)MEFMVCPOC\Views"
Update: here's the working version
xcopy "$(ProjectDir)Views\ModuleAHome\Index.cshtml" "$(SolutionDir)MEFMVCPOC\Views\ModuleAHome\" /Y /I
Here are some commonly used switches with xcopy
:
- /I - treat as a directory if copying multiple files.
- /Q - Do not display the files being copied.
- /S - Copy subdirectories unless empty.
- /E - Copy empty subdirectories.
- /Y - Do not prompt for overwrite of existing files.
- /R - Overwrite read-only files.