简体   繁体   中英

xcopy command to move app.manifest from obj to bin folder failed on build server

I have added app.manifest file to my WPF client project to make it to Run as Admin. I was getting app.manifest file not found in bin folder error. I resolved this issue by adding XCopy command in post build event of my project. XCOPY command copies manifest files from obj folder to bin folder. My project builds successfully locally.

%windir%\system32\xcopy "$(SolutionDir)AppName\obj\$(Configuration)\AppName.exe.manifest" "$(SolutionDir)AppName\bin\$(Configuration)" /i /D /y /s /r /c

%windir%\system32\xcopy "$(SolutionDir)AppName\obj\$(Configuration)\AppName.application" "$(SolutionDir)AppName\bin\$(Configuration)" /i /D /y /s /r /c

But when I check-in TFS, I am getting build error in Build server. Manifest files are not created in the obj folder on the build server.

I am not getting how to resolve the issue.

Add the manifest file to your project in Visual Studio and set its Build Action property to Content and its Copy to Output Directory property to Copy if newer . Then it will be copied to the output folder when you build without you having to use any manual xcopy commands.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM