Azure Worker Role Config File Transformations

前端 未结 4 794
小鲜肉
小鲜肉 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:33

    There is one trick. Perhaps someone will come in handy. Azure Worker Role builder includes files that marked as "Copy". But app.config will be transform in WorkerRole1.dll.config (or some else), that is not exists in design-time. To cheat VS:

    Unload role project .csproj.

    Find ItemGroup section with including files in project. I have next few:

    
      Designer
    
    
      app.config
    
    
      app.config
      Designer
    
    

    Then set before or after:

    
      Always
      WorkerRole1.dll.config
    
    

    This trick says to builder "WorkerRole1.dll.config" is exists as a link, this one will be obtained after build (and transformations) and include in WorkerRole package.

提交回复
热议问题