gpt4 book ai didi

visual-studio-2015 - MSBuild 错误 : MSBUILD : error MSB1009: Project file does not exist

转载 作者:行者123 更新时间:2023-12-04 13:31:05 30 4
gpt4 key购买 nike

我对 MSBuild 环境非常陌生,在尝试构建我正在开发的应用程序之一时,我正在遵循一些说明。按照应用程序文档中编写的说明,我能够构建一个如下所示的命令:

msbuild /t:Harvest;WIX setup.build;  /P:publish_location="C:\Installer";product_file="C:\Temp\ServiceHost.dll";product_id="1.0"

但是当我运行命令时,它会引发以下错误:

MSBUILD : error MSB1009: Project file does not exist.



这引发了很多问题:
  • 此处没有名为 Project 的参数。我不确定为什么它在该特定参数上失败?
  • “/t:Harvest;WIX”是什么意思?
  • 通常 msbuild 命令指的是 .sln 或 .csproj 文件,但我所指的文档特别希望我指的是 .Dll 文件,所以我这样做了。我这样做对吗?
  • 我该如何解决这个错误?

  • 仅供引用,下面是我所指的文档:

    This solution is only includes an installer. In order to create an MSI with this solution by hand, you need to bring up a visual studio command prompt, navigate to the setup.build location of the Installer project and type the following command: (where the publish location is replaced by the current publish location, product_id is replaced with current product_id, and product_file is the file you want to pull the version from) msbuild /t:Harvest;WIX setup.build /p:publish_location="location";product_file="Matchbox.Management.ServiceHost.dll";product_id="xxxxxxxxxxxx"

    最佳答案

    来自 MSBuild Command Line Reference :

    MSBuild.exe [Switches] [ProjectFile]


    所以 setup.build是您的项目文件(似乎找不到)。

    /target:targets

    Builds these targets in this project. Use a semicolon or a comma to separate multiple targets, or specify each target separately. /t is also acceptable.



    所以
    /t:Harvest;WIX

    表示您正在构建目标 HarvestWIX这应该在您的项目文件中定义。

    /property:name=value

    Sets or overrides these project-level properties, where name is the property name and value is the property value. Use a semicolon or a comma to separate multiple properties, or specify each property separately. /p is also acceptable.



    所以
    /P:publish_location="C:\Installer";product_file="C:\Temp\ServiceHost.dll";product_id="1.0"

    只需定义三个属性,可在您的 MsBuild 项目中用于任何目的。因此,我们无法判断您这样做是否正确。但它似乎是根据您的文档。

    关于visual-studio-2015 - MSBuild 错误 : MSBUILD : error MSB1009: Project file does not exist,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42305556/

    30 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com