Reputation: 3338
I have a UWP project, in visual studio 2017, it can build without a problem. But when I write script to build in Jenkins, I use below command:
nuget restore MySolution.sln
MSBuild.exe MySolution.sln /t:Clean;Build /p:Configuration=Release /p:Platform=x64 rem /verbosity:diagnostic
But I see the error: Autofac.Extras.CommonServiceLocator 5.0.0 is not compatible with UAP,Version=v10.0.16299. Some packages are not compatible with UAP,Version=v10.0.16299.
How in visual studio 2017 it doesn't think the packages are incompatible, but in MSBuild, it takes them as incompatible?
Upvotes: 1
Views: 1001
Reputation: 23924
Autofac.Extras.CommonServiceLocator supports netstandard 2.0. According to the docs on netstandard netstandard 2.0 and Universal Windows 10.0.16299 are compatible. This is why it works fine in VS.
If NuGet restore is not seeing these things as compatible, that's usually a problem with the NuGet command line version being used. Sometimes it also has to do with a NuGet.config file incorrectly being in the same folder as NuGet.exe and directing NuGet to use a different set of feeds than VS is using.
All of this adds up to a tooling problem, which, without a repro and logs, is very hard to troubleshoot. As I mentioned in my comments, more info is needed.
If Autofac.Extras.CommonServiceLocator switched to use CommonServiceLocator 2.0.3 it might enable targeting a lower netstandard, but that likely won't solve your problem - it's already compatible, as you've seen in VS.
I would recommend:
nuget locals clear -all
Then try again.
I'm sorry there's not much more I can offer. Like you said, it works in one spot, not in another. That's a tooling and environment problem, which, without a repro or specific set of repro steps that work on other machines, is really hard to solve.
Upvotes: 1