Azure Worker Role Config File Transformations

前端 未结 4 797
小鲜肉
小鲜肉 2021-02-06 01:18

I\'ve setup a new worker role and setup a couple of new config transforms for it via SlowCheetah. When I build the project with one of the new configs selected, I do in fact see

4条回答
  •  北荒
    北荒 (楼主)
    2021-02-06 01:42

    I find @Frans answer too complicated, and below is the code I found in the internet. Given that you already have your app.config transformation set up and working, open your cloud project (.ccproj) in text editor, find this line:

    
    

    and insert the following after it:

      
      
        
      
      
    

    and replace YOUR-PROJECT-NAME with your worker project name.

    UPDATE

    I actually found a better way to do this (MSBuild 4+): script above will NOT work if you have more than 1 worker role with app.config transformations in your Azure project. Here is the more generalized way:

      
        
             $([System.IO.Path]::GetDirectoryName($(MSBuildProjectDirectory)))
        
    
        
        
    

提交回复
热议问题