Including XML files in Visual Studio Project Build

In SharePoint or .Net, we may run into some serious issues when your Visual Studio solution contains XML files and that files are not being copied or included into the "Bin" folder or "Debug" folder and doesn't show any error or warning while building the application or run time.



Solution:
We can solve this problem by adding the "Build Events" to the Solution Properties.

  • Open the Solution with Visual Studio.
  • Open the Solution Properties by right clicking on the solution > Select Properties.
  • Select "Build Events" and add the below line of command.
xcopy /Y /S /i "$(ProjectDir)Data\*" "$(TargetDir)Data"

  • Rebuild the Solution file which solves your problem.
Note 1: For more Options, Click on "Edit Post-Build .." > "Macros >>".
Note 2: You can also include any files and Folders with this option.

Reference for More XCOPY Options : "MSDN"
SHARE

Sudheer Gangumolu

I'm a Software Analyst / Developer / Blogger, having good experience in working with different flavors & Customization of SharePoint (i.e.,SP O365 / 2013 / 2010 / 2007) and .Net Apps. Currently, working on SharePoint 2013 / SharePoint O365. Guiding people on my technologies.

    Blogger Comment
    Facebook Comment

1 comments :

  1. This information is impressive; I am inspired with your post writing style & how continuously you describe this topic. After reading your post, thanks for taking the time to discuss this, I feel happy about it and I love learning more about this topic.
    dot net training institutes in chennai|dotnet training in chennai

    ReplyDelete