MSBuild Error : MSBUILD : error MSB1009: Project file does not exist
From the MSBuild Command Line Reference:
MSBuild.exe [Switches] [ProjectFile]
So setup.build
is your project file (which it seems cannot be found).
/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.
so
/t:Harvest;WIX
means you are building targets Harvest
and WIX
which should be defined in your project file.
/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.
so
/P:publish_location="C:\Installer";product_file="C:\Temp\ServiceHost.dll";product_id="1.0"
simply defines three properties which can be used for any purpose in your MsBuild project. So we cannot tell whether you are right in doing so. But it seems to be according to your documentation.
Lost
Updated on June 28, 2022Comments
-
Lost almost 2 years
I am very new to MSBuild environment and while trying to build one of the application that I am working on, I am following some instructions. By following the instructions written in the application documentation, I was able to build a command which looks like below:
msbuild /t:Harvest;WIX setup.build; /P:publish_location="C:\Installer";product_file="C:\Temp\ServiceHost.dll";product_id="1.0"
But when I run the command, it throws following error:
MSBUILD : error MSB1009: Project file does not exist.
Which raises a lot of questions:
- There is no parameter named Project here. I am not sure why it is failing on that particular parameter?
- what does "/t:Harvest;WIX" mean?
- Normally msbuild command refers to .sln or .csproj file but the documentation that I am referring to particularly wants me to refer to .Dll file so I did. Am I right in doing so?
- How can I solve this error?
Just for reference below is the documentation that I am referring to:
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"