简体   繁体   English

输入预构建命令行后无法重建解决方案

[英]can't rebuild solution after entering a pre-build command line

I have just upgraded my visual studio to the 2015 edition. 我刚刚将视觉工作室升级到2015版。

I have a solution with just two project. 我只有两个项目有一个解决方案。 I can rebuild the solution and run the code fine. 我可以重新构建解决方案并运行代码。 However I have an issue when I enter a parameter in the Properties > Build Events > Pre-build event command line. 但是,当我在“属性”>“构建事件”>“预构建事件”命令行中输入参数时遇到问题。

I have simply entered the following in the text box, 我只是在文本框中输入了以下内容,

/MTEST

When I try to rebuild the solution I get the error message "The command "/MTEST" exited with code 9009". 当我尝试重建解决方案时,出现错误消息“命令“ / MTEST”以代码9009退出”。

static void Main(string[] args)
    {
        if (args.Length == 0)
            NormalMonring();
        else
        {
            for (int i = 0; i < args.Length - 1; i++)
            {
                switch(args[i].ToUpper())
                {
                    case "/AUTO":
                        //code
                    case "/MTEST":
                        // code
                        break;
                }
            }
        }
    }

I have done something similar to this before and not had any issues don't understand what is happening? 我之前做过类似的事情,没有遇到任何不了解正在发生什么问题的问题吗?

Pre-build event command line is meant for running command line programs before the build. 生成前事件命令行用于在生成之前运行命令行程序。 Like if you have something that generates code that you will then build. 就像您有生成代码的东西,然后将其生成一样。 If you are looking to pass that value to your console application when you debug it then you can set it in Debug->Start Options->Command line arguments. 如果希望在调试时将该值传递给控制台应用程序,则可以在“调试”->“启动选项”->“命令行参数”中进行设置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM