We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Reference two different 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?

@Glority_Developer

Please create a standalone Visual Studio application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing. Please also share the .NET version that you are using. We will investigate the issue and provide you more information on it.

Here is a Google Drive share link.

It is an empty WPF project, created using Visual Studio 2019 WPF project template. We don’t modify any code, just add reference to Aspose.Imaging and Aspose.PDF, which are located in the ‘lib’ folder.

You can just unzip it, open the solution and build it, you could see those warnings.

@Glority_Developer

We have tested the scenario and have not found the shared issue. Please check the attached images.

application.png (105.3 KB)
.NET Version.png (38.2 KB)

@tahir.manzoor

This application can run, but there are build warnings. You can just right click on this project or solution, click rebuild, and you can see this :

image.png (38.7 KB)

Can you check it again, thanks.

@Glority_Developer

We have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as PDFNET-51669. You will be notified via this forum thread once this issue is resolved. We apologize for your inconvenience.

Regarding Aspose.Imaging, your query will be answered in Aspose.Imaging forum.