How does one build a .csproj from command line having a log written to a specified location?

前端 未结 3 2036
遇见更好的自我
遇见更好的自我 2021-02-19 03:47

While the \'no-log\' build seems to work smoothly with something like

\"c:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\ide\\VCSExpress\" Project

相关标签:
3条回答
  • 2021-02-19 04:28

    Under the hood, Visual Studio uses msbuild for all it's build magic. As far as I know, this applies to the Express editions as well.

    If you don't have it already, MSBuild is a part of the .NET SDK.

    Calling MSBuild has the advantage of doing the build directly - calling VCSExpress will just introduce overhead.

    Here's the MSBuild commandline that I've used:

    msbuild.exe <solution> 
        /t:rebuild 
        /verbosity:quiet 
        /logger:FileLogger,Microsoft.Build.Engine;logfile=<filePath>
    

    Should work the same with <project> instead of <solution>.

    0 讨论(0)
  • 2021-02-19 04:40

    In the window that pops up with all the info.. it gives you the error:

    Missing switch argument. Configuration name required for /build switch.

    And then it gives you a bunch of info including this:

    Command line builds: vcsexpress solutionfile.sln /build [ solutionconfig ]

    It just wants to know what kind of solution config you have - I think either "Release" or "Debug". Not sure if vcsexpress has the "Configuration Manager" or Solution Build Property Pages under the "Build" Menu.. but this would be where you could double check your current settings. See the "Active Solution Configuration".. this person ran into this, check out their screen shot of it: MSBuild task configuration property

    0 讨论(0)
  • 2021-02-19 04:46

    You have to specify the configuration after the /build option. Also, the log file must already exist, it doesn't create one from scratch. Thus:

    copy con > log.txt
    ^Z      // Type Ctrl+Z
    "c:\Program Files\Microsoft Visual Studio 9.0\Common7\ide\VCSExpress" Project1.csproj /build debug /log log.txt
    
    0 讨论(0)
提交回复
热议问题