Open eiriktsarpalis opened 6 years ago
Are you referencing the Microsoft.Azure.DocumentDB.Core
for some particular feature? The Microsoft.Azure.DocumentDB.ChangeFeedProcessor
already contains a reference to it.
Yes, I need to reference both. The problem however is that Microsoft.Azure.DocumentDb.ChangefeedProcessor
also forces Microsoft.Azure.DocumentDB
to be loaded. Please see the reproduction solution.
Correct, this is because your main project is targeting net471
. The Change Feed Processor is using the Cosmos DB SDK Full Framework package for net471
and the Core package for netstandard2.0
, it's the only way to be able to multi-target as the SDK has two different projects at this moment.
As you said, this would be solved if the SDK were a single package, which is currently being worked on.
The only workaround I see is to remove the Microsoft.Azure.DocumentDB.Core
explicit reference and let the chain resolve to the package that works in the consuming app.
If you app is net471
it will resolve to the Full Framework package, and if your app is netcoreapp
it will resolve to the Core package.
The only workaround I see is to remove the Microsoft.Azure.DocumentDB.Core explicit reference and let the chain resolve to the package that works in the consuming app.
That is true, however in the real codebase we need to reference the cosmos db sdk in the shared netstandard class library.
@eiriktsarpalis We are doing this and it seems to be working out ok:
<ItemGroup Condition=" '$(TargetFramework)' == 'net462' ">
<PackageReference Include="Microsoft.Azure.DocumentDB" Version="2.1.3" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="Microsoft.Azure.DocumentDB.Core" Version="2.1.3" />
</ItemGroup>
My team is working on a net471 solution that makes heavy use of the DocumentDB and ChangefeedProcessor SDKs. We're looking at migrating parts of the solution to netstandard2.0 and netcoreapp2.0, however we are blocked by build issues triggered by the peculiar dependency structure that your nuget packages are employing (namely, different nuget packages for the netstandard and net4x core SDKs, which are both referenced by a multi-targeted release of the changefeed SDK).
Here is a minimal reproduction that highlights the problem
Building results in the following error:
I cannot make this error go away unless I either remove the changefeedprocessor reference from the netstandard library or upgrade the console application to netcoreapp. It is blocking us from upgrading our shared libraries to netstandard.
I believe that this error would go away if you were to also multi-target the core SDK. Perhaps something to consider in anticipation of the
2.0
release?