Build Error for UWP app Microsoft.Bcl.Build and packages.config next to the project file

emseetea picture emseetea · Feb 18, 2016 · Viewed 8.7k times · Source

I am getting a strange build error when building Windows Universal apps.

Severity Code Description Project File Line Suppression State Error Could not locate C:\Users\me\Source\Repos\TT\Windows\MyCommonLibrary\packages.config. Ensure that this project has Microsoft.Bcl.Build installed and packages.config is located next to the project file. MyApp

'MyApp' has a project reference to 'MyCommonLibrary'.

What is really weird is that even though it is displayed as a build 'error'. This does not effect my ability to build 'MyApp' or 'MyCommonLibrary'!

It also does not prevent me from deploying and running my app locally or otherwise. It is just a annoying to see this listed as a build error when it doesn't break the build!

Answer

RandomEngy picture RandomEngy · Jun 7, 2016

I followed up with the Bcl.Build package owners and got a response from Eric St. John. He says that you shouldn't reference Bcl.Build in your UWP project that uses project.json, and there's a project property to suppress the warning that is telling you to do so.

Correct, the problem is most of the packages out there that use it also don’t know about UWP either and if they update for UWP we want them to drop this dependency rather than make it work. The package isn’t needed at all for UWP or any framework that supports project.json.

To work around the error with the old package do the following:

Add <SkipValidatePackageReferences>true</SkipValidatePackageReferences> to the at the top of your csproj/vbproj