Visual Stuido, or VS

VS

A lot of people suggest editing the pubxml file.  Don’t do it.

A lot of people suggest adding pre-build instructions.  Don’t do it.

I recommend simply including the file in your project and setting the “Copy to Output Directory” property to “Copy always“.

If you need a folder, but don’t want the contents, create a readme.txt file and mark it as “Copy always” to force the directory to copy.

pubxml technique:

http://stackoverflow.com/questions/16790322/adding-extra-files-to-published-mvc-api-project

<Target Name=”CustomCollectFiles”>

<ItemGroup>

<_CustomFiles Include=”$(MSBuildProjectDirectory)\bin\MySpecialFile.txt” />

<FilesForPackagingFromProject Include=”%(_CustomFiles.Identity)”>

<DestinationRelativePath>bin\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>

</FilesForPackagingFromProject>

</ItemGroup>

</Target>

 

<PropertyGroup>

<CopyAllFilesToSingleFolderForPackageDependsOn>

CustomCollectFiles;

$(CopyAllFilesToSingleFolderForPackageDependsOn);

</CopyAllFilesToSingleFolderForPackageDependsOn>

 

<CopyAllFilesToSingleFolderForMsdeployDependsOn>

CustomCollectFiles;

$(CopyAllFilesToSingleFolderForPackageDependsOn);

</CopyAllFilesToSingleFolderForMsdeployDependsOn>

</PropertyGroup>

custom build technique:

https://msdn.microsoft.com/en-us/library/aa833213(v=vs.100).aspx

For information about how Acumen can help with your IT needs, call us today!