Skip to content

Instantly share code, notes, and snippets.

@sdurandeu
sdurandeu / gist:80b286cd0c3971576d39
Last active June 13, 2022 13:55
MsBuild: Add custom files in web deploy package
<Target Name="AdditionalFilesForPackage" AfterTargets="CopyAllFilesToSingleFolderForPackage;CopyAllFilesToSingleFolderForMsDeploy">
<ItemGroup>
<AppDataFiles Include="$(MSBuildProjectDirectory)\App_Data\**\*" />
</ItemGroup>
<Copy SourceFiles="@(AppDataFiles)" DestinationFiles="@(AppDataFiles->'$(_PackageTempDir)\App_Data\%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" />
</Target>
@derekgates
derekgates / SetAssemblyInfoToVersion.ps1
Last active April 14, 2021 20:07
Changes version information in AssemblyInfo.cs files recursively from a given path. I use this with TeamCity to control the version number as the built in Build Feature runs before my psake script can obtain the version (clearing out the version!).
# SetAssemblyVersion.ps1
#
# http://www.luisrocha.net/2009/11/setting-assembly-version-with-windows.html
# http://blogs.msdn.com/b/dotnetinterop/archive/2008/04/21/powershell-script-to-batch-update-assemblyinfo-cs-with-new-version.aspx
# http://jake.murzy.com/post/3099699807/how-to-update-assembly-version-numbers-with-teamcity
# https://github.com/ferventcoder/this.Log/blob/master/build.ps1#L6-L19
Param(
[string]$path=$pwd
)