简体   繁体   中英

C# why empty src folders are copied to the debug and release directory after build?

We are using Visual Studio 2008 professional. We have created an entity data model in our src\\systeminfo folder. Since then our release and debug folder have a empty src\\systeminfo folder. we don't need them. how to stop VS to create that empty folder structure? thanks

EDIT:

current directory tree:

project\Properties
project\References
project\src
project\src\common
.
.
project\src\systeminfo
project\src\util
project\App.config
project\Settings.cs

You'd have to dig through the msbuild .target files to find out what build rule creates this folder. You might get a hint from looking at the build log if you switch it to diagnostic. Tools + Options, Project and Solutions, Build and Run.

A more pragmatic approach would be to just delete the folders in a post build event. Like:

if exist "$(TargetDir)src\systeminfo" rmdir "$(TargetDir)src\systeminfo"
if exist "$(TargetDir)src" rmdir "$(TargetDir)src"

Even more pragmatic is to not worry about it...

There is an option to 'Copy to Output Directory' on the properties window. Set it to 'Do not copy' for these folders

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