Reputation: 23
I have a .NET 6 WPF application with 52 projects. For one of the projects, I need a post-build event to copy files from one directory if the Platform is "Any CPU" and from another directory if the Platform is "x86".
I've tried many things I've found from Google searches, but have been unsuccessful.
What I have at this point is:
if $(PlatformName) EQU "Any CPU" ( xcopy "$(SolutionDir)MyFiles_64\*.*" "$(SolutionDir)SysBin\WebView2\" /s/c/r/y/d )
if $(PlatformName) EQU "x86" ( xcopy "$(SolutionDir)MyFiles_32\*.*" "$(SolutionDir)SysBin\WebView2\" /s/c/r/y/d )
Upvotes: 0
Views: 36
Reputation: 1393
You want to use if () ELSE ()
like below:
if $(PlatformName) EQU "x86" (
xcopy "$(SolutionDir)MyFiles_32\*.*" "$(SolutionDir)SysBin\WebView2\" /s/c/r/y/d
) ELSE (
xcopy "$(SolutionDir)MyFiles_64\*.*" "$(SolutionDir)SysBin\WebView2\" /s/c/r/y/d
)
Upvotes: 0