Post build event depending on configuration name in new ASP.NET 5 project

前端 未结 2 1415
予麋鹿
予麋鹿 2020-12-17 01:22

I\'m writing a unified project for 3 smart TVs. I have also 3 configurations created in Visual Studio. Now I want to execute some CLI scripts depen

2条回答
  •  臣服心动
    2020-12-17 01:41

    I investigated on this a bit but did not really get to any good result.

    There are some project variables that are exposed in scripts. Unfortunately, those are very limited:

    • %project:Name% gives you the project name
    • %project:Directory% gives you the project directory
    • %project:Version% gives you the project version

    So there is no way to access the build configuration or the environment here.

    The configurations option in the project.json is also limited to build configurations and only allows declaring compilation options there, so that also doesn’t work.

    Unfortunately, there also doesn’t seem to be another way to solve this. At least not right now. I would consider myself sending a pull request to DNX to add some additional project variables which one could use but at the moment, it doesn’t really make any sense to invest time into DNX: After all it’s being replaced by the dotnet CLI. We’ll see if that one will come with functionality to access the environment—and if not, I might end up submitting a pull request to add this functionality. But until we get there, I’m afraid there is no solution for this.

提交回复
热议问题