Project reference conditional include with multiple conditions

我是研究僧i 提交于 2019-12-20 09:09:04

问题


Here's a snippet from my csproj file:

<ProjectReference Include="..\program_data\program_data.csproj" Condition="'$(Configuration)'=='Debug'">
      <Project>{4F9034E0-B8E3-448E-8794-CF9B9A5E7D46}</Project>
      <Name>program_data</Name>
</ProjectReference>

What I'd like to do is include program_data.dll for multiple build configurations, for example, both Release and Debug.

I tried doing the following

Condition="'$(Configuration)'=='Debug' || '$(Configuration)'=='Release'"

but Visual Studio chokes on this.

Is there a way I can do this, or must I have a separate <ProjectReference> for each build config?


回答1:


You should use Or, not ||:

Condition="'$(Configuration)'=='Debug' Or '$(Configuration)'=='Release'"


来源:https://stackoverflow.com/questions/6312098/project-reference-conditional-include-with-multiple-conditions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!