开发者

VB.NET 2003 copy log4net.config to bin folder

开发者 https://www.devze.com 2022-12-15 01:39 出处:网络
I\'m using VS.NET 2003 and VB.NET. I have placed my log4net.config file in the same folder as the source code and I want to automatically copy the log4net.config file to the bin folder just as the app

I'm using VS.NET 2003 and VB.NET. I have placed my log4net.config file in the same folder as the source code and I want to automatically copy the log4net.config file to the bin folder just as the app.config f开发者_Go百科ile is copied to bin. Is there an automatic way to do this?


Include it as a resource, and choose copy always.

You can do this by:

  1. Click on your vbproj file and choose "Add Existing item"
  2. Navigte to the config file and select it
  3. Right click on the config file and make sure it is not set to "embedded resource" (you dont want it embedded in your exe or dll)
  4. Make sure its build action is set to "Copy always"
  5. Build, and check your build directory it should be there

I dont have my IDE open, so the steps might need a little tweaking.


Add a post build event - http://geekswithblogs.net/dchestnutt/archive/2006/05/30/80113.aspx

Something like:-

copy "$(ProjectDir)log4net.config" "$(ProjectDir)$(OutDir)"

should do it.

0

精彩评论

暂无评论...
验证码 换一张
取 消