Rui Jarimba
Rui Jarimba

Reputation: 17979

VSTS - The system cannot find the path specified

I am trying to compile a solution on Visual Studio Team Services (VSTS), using the hosted agent. One of the projects in the solution has a Pre-build event:

cmd /c $(SolutionDir)Tools\GenerateResourceLibrary\bin\$(ConfigurationName)\GenerateResourceLibrary.exe $(ProjectDir)

This command is used to generate a resource file (.resx).

Everything works as expected locally, and it was working fine on VSTS until a few weeks ago. At the moment I can't compile the solution, error message is the following:

The system cannot find the path specified

I've checked the logs on the build server, both the tool path (GenerateResourceLibrary.exe) and the $(ProjectDir) seem to be correct. Also, I've tried changing the command slightly (putting quotes, etc) but nothing seems to work.

I was just wondering what might have changed on the hosted agent, given that this was working fine until a few weeks ago. Maybe it's a permissions issue?

Upvotes: 1

Views: 4331

Answers (2)

Rui Jarimba
Rui Jarimba

Reputation: 17979

I was finally able to find a workaround - thanks to @Eddie and @starain who pointed me in the right direction.

The strange thing is that the project seems to have the right dependencies because it compiles successfully locally. But, as mentioned by Eddie, GenerateResourceLibrary.exe was generated later than pre-build event. In order to fix this I added a task that compiles the GenerateResourceLibrary project before trying to compile the solution.

Task was configured as follows:

enter image description here

Upvotes: 3

starian chen-MSFT
starian chen-MSFT

Reputation: 33698

Make sure current project depends on GenerateResourceLibrary project.

Right click on your solution=>Properties=>Project Dependencies=>Select your project=>Check the option of GenerateResourceLibrary project.

Upvotes: 2

Related Questions