How do you pass conditional compilation symbols (DefineConstants) to msbuild

前端 未结 2 1704
独厮守ぢ
独厮守ぢ 2020-12-10 01:23

So, both this and this are pretty clear. Simply pass /p:DefineConstants=\"SYMBOL\"

It doesn\'t work at all for me, even in a test project. I\'m expectin

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-10 01:50

    It seems you are not passing conditional compilation symbol. That's why you are getting output as : No environment provided. Just go to project properties and than click on build tab (left side below application). you will find one box asking for conditional compilation symbol. Just write your constants as per your desired output. for ex. in your example, to print "DEV" write DEV at conditional compilation box and rebuild your project. i am sure it will work.

    Note: if you want pass any symbol than as per your code it will print : No environment selected.

提交回复
热议问题