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!
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
I believe this is a false positive from the Nuget Update to 3.1.
For the time I solved it by creating the packages.config Visual Studio demands manually out of the existing project.json.
For instance:
project.json
{
"dependencies": {
"Microsoft.Bcl.Build": "1.0.21",
"Newtonsoft.Json": "8.0.2"
},
"frameworks": {
"uap10.0": {}
},
"runtimes": {
"win10-arm": {},
"win10-arm-aot": {},
"win10-x86": {},
"win10-x86-aot": {},
"win10-x64": {},
"win10-x64-aot": {}
}
}
packages.config
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Bcl.Build" version="1.0.21" targetFramework="uap10.0" />
<package id="Newtonsoft.Json" version="8.0.2" targetFramework="uap10.0" />
</packages>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With