Config Transformation on NLog does not work

前端 未结 10 1835
悲&欢浪女
悲&欢浪女 2021-02-05 09:15

I have a web project (ASP.NET MVC 4 project) that has a number of configurations stored in Web.Config and in NLog.config files.

I have

10条回答
  •  半阙折子戏
    2021-02-05 10:14

    I've managed it without moving all configuration into web.config or app.config. (There is nothing, connected with nlog in web/app.config at all).

    1) Using this article: applying msbuild config transformations to any config file I've created all transformations, which are necessary and added transformation task.

    2)Then I've checked if there are any other tasks, which do similar things. In my case there was one, which had been created by SlowCheetah(VS extension to automatically add transformations). I've removed it - and everything became ok. (SlowCheetah can restore its settings on next build, so it is better to remove it or suppress its transformation task)

    3) My transform files look like this one:

    
    
    
      
        
        
      
      
        
        
      
    
    

提交回复
热议问题