Reference two different Aspose libraries with two different versions causing build warnings

Hi Aspose team,

We’re using Aspose.Imaging for .NET v20.3 and Aspose.PDF for .NET v20.3 in one project. Since new versions fixed some bugs we met, we decide to update Aspose.PDF v20.3 to v22.3.

When we copy and replace the Aspose.PDF v20.3 with v22.3, re-referenced, and build the project, it shows many warnings:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277: Found conflicts between different versions of "Aspose.Imaging" that could not be resolved.
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277: There was a conflict between "Aspose.Imaging, Version=20.3.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56" and "Aspose.Imaging, Version=22.3.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56".
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:     "Aspose.Imaging, Version=20.3.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56" was chosen because it was primary and "Aspose.Imaging, Version=22.3.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56" was not.
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:     References which depend on "Aspose.Imaging, Version=20.3.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56" [D:\Temp\Test\Test\lib\Aspose.Imaging.dll].
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:         D:\Temp\Test\Test\lib\Aspose.Imaging.dll
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:           Project file item includes which caused reference "D:\Temp\Test\Test\lib\Aspose.Imaging.dll".
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:             Aspose.Imaging
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:     References which depend on "Aspose.Imaging, Version=22.3.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56" [].
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:         D:\Temp\Test\Test\lib\Aspose.PDF.dll
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:           Project file item includes which caused reference "D:\Temp\Test\Test\lib\Aspose.PDF.dll".
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3277:             Aspose.PDF

It is easy to reproduce, create a .NET project, and add reference to Aspose.Imaging v20.3 and Aspose.PDF v22.3.

In the warning information, the second line, the

“Aspose.Imaging, Version=22.3.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56”

should be

“Aspose.PDF, Version=22.3.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56”

We have no idea why this would happen. If we update both Aspose.Imaging and Aspose.PDF to the same version (etc. v22.3), there won’t be those warnings, but if we update Aspose.Imaging from v20.3 to v22.3, we need to change a lot of our code, and have to do massive test. We don’t have that time before our code freeze.

Can you help with these warning? Why is that happened, and how to avoid that?


This Topic is created by tahir.manzoor using Email to Topic tool.

@Glority_Developer
It’s normal behaviour because Aspose.PDF uses the latest Aspose.Imaging .NET internally.
So you need to do the same in your project.