Unable to apply publish properties for item X

后端 未结 2 1191
余生分开走
余生分开走 2020-12-30 18:24

Whenever we do a build in our main solution we receive the following warning:

Unable to apply publish properties for item \"microsoft.visualstudio.q

2条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-30 18:50

    The top voted answer is perfect as it stands, but those of us dealing with larger outbursts may benefit from this alternative answer. It describes an analogous fix on file level.

    The warning is caused by an element like this:

    
      False
      
      
      
      
      Exclude
      True
      Assembly
    
    

    ...in the project file (.csproj) emitting the warning. Notice the PublishState "Exclude"; this element says "please don't publish the imaginary DLL"; this is obviously a needless instruction if no such DLL is anywhere around at publish time, but it is then also causing the warning because the publish process cannot evaluate the file's identity.

    You can remove the entire PublishFile element for each deployment item mentioned in the warnings, as long as it has PublishState "Exclude". Do not mechanically remove every element with PublishState "Exclude", because if there was no warning about it, the file is probably available at publish time and it might end up published - which would be an unwanted product change as long as you only wanted to get rid of the warning.

提交回复
热议问题