1

I am creating my first Azure Function(V1) with SharePointPnPCoreOnline package and Visual Studio 2019/2017. When I created a function project without SharePointPnPCoreOnline its working without any error.

But when I added SharePointPnPCoreOnline its started giving me warning message like below

NU1608: Detected package version outside of dependency constraint: Microsoft.Data.Services.Client 5.6.4 requires Microsoft.Data.OData (= 5.6.4) but version Microsoft.Data.OData 5.8.4 was resolved. NU1107: Version conflict detected for Newtonsoft.Json. Install/reference Newtonsoft.Json 11.0.1 directly to project CRB.Functions to resolve this issue. Functions -> SharePointPnPCoreOnline 3.18.2002 -> Newtonsoft.Json (>= 11.0.1) CRB.Functions -> Microsoft.NET.Sdk.Functions 1.0.24 -> Newtonsoft.Json (= 9.0.1). Package restore failed. Rolling back package changes for 'Functions'.

Upon my research I came across with below post from elio where the solution has been suggested for this problem.

https://www.eliostruyf.com/using-the-latest-sharepoint-pnp-core-online-dependency-in-your-azure-functions/

Based on recommendation from this post, solution to this problem is to install "Newtonsoft.Json" package before installing "SharePointPnPCoreOnline".

When I install "Newtonsoft.Json 12.0.1" got below warning.

NU1608 Detected package version outside of dependency constraint: Microsoft.NET.Sdk.Functions 1.0.24 requires Newtonsoft.Json (= 9.0.1) but version Newtonsoft.Json 12.0.1 was resolved.

And now I am stuck because I added a reference "Newtonsoft.Json" to my function v1 project with warnings. Should I ignore this warning and continue?

enter image description here

2/21/2020

After having a discussion @Derek with I have also tested this with Azure Function V2 and Azure Function V3 and got warnings in both scenarios.

github repo https://github.com/ravick4u/AzureFunV1WithPnP

Errors with Azure Function V2

Warning NU1608 Detected package version outside of dependency constraint: Microsoft.Data.Services.Client 5.6.4 requires Microsoft.Data.OData (= 5.6.4) but version Microsoft.Data.OData 5.8.4 was resolved. 1

Warning NU1701 Package 'Microsoft.AspNet.WebApi.Core 5.2.3' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v2.1'. This package may not be fully compatible with your project.

Warning NU1701 Package 'Microsoft.Azure.ActiveDirectory.GraphClient 2.1.0' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v2.1'. This package may not be fully compatible with your project.

Warning NU1701 Package 'Microsoft.Data.Services.Client 5.6.4' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v2.1'. This package may not be fully compatible with your project.

Warning NU1701 Package 'Microsoft.IdentityModel 6.1.7600.16394' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v2.1'. This package may not be fully compatible with your project.

Warning NU1701 Package 'Microsoft.SharePointOnline.CSOM 16.1.19724.12000' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v2.1'. This package may not be fully compatible with your project.

Warning NU1701 Package 'SharePointPnP.IdentityModel.Extensions 1.2.4' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v2.1'. This package may not be fully compatible with your project.

Warning NU1701 Package 'SharePointPnPCoreOnline 3.18.2002' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v2.1'. This package may not be fully compatible with your project.

Errors with Azure Function V3

Warning NU1701 Package 'Microsoft.AspNet.WebApi.Core 5.2.3' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v3.0'. This package may not be fully compatible with your project.

Warning NU1701 Package 'Microsoft.Azure.ActiveDirectory.GraphClient 2.1.0' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v3.0'. This package may not be fully compatible with your project.

Warning NU1701 Package 'Microsoft.Data.Services.Client 5.6.4' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v3.0'. This package may not be fully compatible with your project.

Warning NU1701 Package 'Microsoft.IdentityModel 6.1.7600.16394' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v3.0'. This package may not be fully compatible with your project.

Warning NU1701 Package 'Microsoft.SharePointOnline.CSOM 16.1.19724.12000' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v3.0'. This package may not be fully compatible with your project.

Warning NU1701 Package 'SharePointPnP.IdentityModel.Extensions 1.2.4' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v3.0'. This package may not be fully compatible with your project.

enter image description here

0

Get rid of the NewtonSoft reference. Azure Functions uses its own Newtonsoft dependency internally, and any explicit references to it will break the project.

12
  • As I mentioned in my post I am adding NewtonSoft because I am unable to add SharePointPnPCoreOnline. without independent NewtonSoft I can not add SharePointPnPCoreOnline Feb 19 '20 at 20:45
  • Oh, I see what you mean now. I've experienced this before but not recently. You might try updating your Visual Studio Azure tools. I'm on VS2019 with the latest Azure dev workload. Good luck! Feb 19 '20 at 21:27
  • I am on VS2019(v16.4.5) which is the latest one and having this issue. Are you also on the same version? Is it possible for you to do a quick test?(1. Create Azure Function V1 and Add SharePointPnPCoreOnline reference) Feb 19 '20 at 21:30
  • Yep, I did it and it worked for me. AZ Function tools ver. 16.4.460.23317| PnP Version 3.18.2002 | Newtonsoft included dependency ver. 11.0.2 | VS 2019 v.16.4.4 Feb 19 '20 at 22:45
  • What kind of trigger are you using? I used an HTTP trigger. Feb 19 '20 at 22:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.