Click here to Skip to main content
15,880,891 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I tried to generate a project with msbuild giving a relative path like "..\..\Path\Project" and in fact the destination of this is determined correctly. However, msbuild returns an error: "Project does not exist."

1st Do I have to specify relative paths with a different syntax using msbuild?
2nd Are there ohter reasons for this error?

[Edit]
MSBuild is called in another project as a PostBuildEvent with the line:
CommandoLine="msbuild ..\..\Path\Project
Now I've discovered that this line in two cases led to
msbuild Project on Command Prompt and in four other cases (in each case "Project" is a different File) it led to
msbuild ..\..\Path\Project on Command Prompt which didn't return an error.
In every case the specific file exist (all files are in the same directory).
I don't believe in computers doing different things with the same command so what is wrong there?
Is it possible that the path from wich is generated is changed by msbuild?

[Edit end]

Thanks in advance for any help.

Regards
Posted
Updated 23-Mar-11 5:09am
v3
Comments
Sandeep Mewara 23-Mar-11 10:44am    
I guess it's relative path formation error only. Try changing it a little.
Apfelmuuus 23-Mar-11 11:06am    
What can I place instead of "..\"?
I don't have an idea!
Sandeep Mewara 23-Mar-11 11:10am    
I mean... try:
"..\..\..\Path\Project"
OR
"..\Path\Project"
some variation to check if it works. Totally brute force it is - I know.
Apfelmuuus 23-Mar-11 11:23am    
No I'm confused!

I tried what you said directly on the command prompt ("msbuild "..\..\..\Path\Project") and it led to the same error.

But then I tried "msbuild ..\..\Path\Project" and it works although

CommandoLine="msbuild ..\..\Path\Project in the other project still returns an error.
Sandeep Mewara 23-Mar-11 11:29am    
Try Hans suggestion.

1 solution

Right before that line, issue the command 'dir' to display the current directory. This will tell you where msbuild thinks it's at.
 
Share this answer
 
v3
Comments
Apfelmuuus 23-Mar-11 12:26pm    
That would be a good idea. Hope it works. I'll try tomorrow.
Regards.
Apfelmuuus 24-Mar-11 4:32am    
All right it showed that the path wasn't changed while building, however I found at random what was wrong. There was another call of msbuild without the relative path, so the first call was ignored.
Although many thanks.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900