My current project class library is in .Net Framework 4.7.2 (target framework) and we are using Microsoft.Azure.DocumentDB package. we have to update to version 3 of Azure Questions

  1. Does we will be able to do update into Microsoft.Azure.Cosmos package with class library in .Net Framework 4.7 or Microsoft.Azure.Cosmos package only supporting ".Net standard" framework ? 2)If Yes, then while migrating code we are getting "Inaccessible due to protection level error" in number of places. 3)If No, then does we need to change class libaray from .Net framework 4.7 to .Net Standard to migrate code ?
1

There are 1 best solutions below

0
On

Microsoft.Azure.Cosmos is a NET Standard 2.0 library, NET Standard is an interface that defines a series of APIs that are implemented by different frameworks: https://learn.microsoft.com/en-us/dotnet/standard/net-standard?tabs=net-standard-2-0

.NET Framework 4.7.2 is a framework implementation, compatible with NET Standard 2.0:

NET Standard table showing the different framework implementations compatible with 2.0

So the answer is, you can use Microsoft.Azure.Cosmos on a .NET 4.7.2 application without issues.

For migration from Microsoft.Azure.DocumentDB to Microsoft.Azure.Cosmos see: https://learn.microsoft.com/azure/cosmos-db/sql/migrate-dotnet-v3

The "Inaccessible due to protection level error" errors you are getting are probably due to your code still referencing APIs or types from Microsoft.Azure.DocumentDB. These are two different Major Version libraries, so your application code needs to change due to the breaking changes.