There is a Windows Forms (NET 3.5) project, foo.csproj, with localized resources files. I use MSBuild to build the project and create a deployment structure:
<MSBuild Projects="foo.csproj" Properties="Configuration=Release;OutputPath=..\deploy\foo" Targets="Build" />
It copies foo.exe and all localized DLL files to the deploy\foo
folder, but I need localized DLL files to be copied into a separate folder. It should be:
Is there a way to configure MSBuild to copy EXE and DLL files to different folders?
Right-click on the project node in Solution Explorer and select Properties. Expand the Build section, and select the Output subsection. Find the Base output path for C#, and type in the path to generate output to (absolute or relative to the root project directory), or choose Browse to browse to that folder instead.
For example, the path to MSBuild.exe installed with Visual Studio 2019 Community is C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe You can also use the following PowerShell module to locate MSBuild: vssetup. powershell.
MSBuild lets you set properties on the command line by using the -property (or -p) switch. These global property values override property values that are set in the project file. This includes environment properties, but does not include reserved properties, which cannot be changed.
Using MSBuild command line, you can specify the output path like below:
C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe <path_to_project_file> /t:Build /p:OutDir=c:\custom_build_out\;Configuration=PRODUCTION;Platform=x64
Note:
OutDir
property for /p, this doesn't work. OutDir
property is for specifying a full path to an alternate directory. OutputPath
is for a relative directory.OutDir
.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With