Friday, December 2, 2016

MSBuild script can't find the packages

Error:

You'll get an error stating it can't find the package even though its in the packages direction and brought down correctly.

Explanation:

The problem that has happened is that when the solution and subsequent projects were associated with it were created they were created in a way that doesn't match up with how things are laid out on the server. The packages compile locally because the packages directory is located relative to where the compiler and local (build script which is visual studio) understands it to be. The MSBuild scripts that are used on the build server know nothing o f this difference.

Solution:
So...
You're going to have to recreate your solution and project associations locally to match what's on the server. So this involves creating the solution file at the root of your web and service project folders. See the before and after images below.

Before:











After:



Further explanation:


As you can see the directory structure is a little different. There is no typical solution directory that you normally create.

No comments:

Post a Comment