Jump to content

WindowsBase version conflict when building PDN 4.3 plugins


Recommended Posts

I encountered a MSBuild warning when updating a few of my FileType plugins for Paint.NET 4.3.

 

Warning    MSB3277    Found conflicts between different versions of "WindowsBase" that could not be resolved.
There was a conflict between "WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" and "WindowsBase, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35".
    "WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" was chosen because it was primary and "WindowsBase, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" was not.
    References which depend on "WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" [C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\5.0.0\ref\net5.0\WindowsBase.dll].
        C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\5.0.0\ref\net5.0\WindowsBase.dll
          Project file item includes which caused reference "C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\5.0.0\ref\net5.0\WindowsBase.dll".
            C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\5.0.0\ref\net5.0\WindowsBase.dll
    References which depend on "WindowsBase, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" [].
        D:\Program Files\paint.net\PaintDotNet.Base.dll
          Project file item includes which caused reference "D:\Program Files\paint.net\PaintDotNet.Base.dll".
            PaintDotNet.Base
            PaintDotNet.Core
            PaintDotNet.Data
        D:\Program Files\paint.net\PaintDotNet.Core.dll
          Project file item includes which caused reference "D:\Program Files\paint.net\PaintDotNet.Core.dll".
            PaintDotNet.Core
            PaintDotNet.Data
        D:\Program Files\paint.net\PaintDotNet.SystemLayer.dll
          Project file item includes which caused reference "D:\Program Files\paint.net\PaintDotNet.SystemLayer.dll".
            PaintDotNet.Core
            PaintDotNet.Data
        D:\Program Files\paint.net\PaintDotNet.Framework.dll
          Project file item includes which caused reference "D:\Program Files\paint.net\PaintDotNet.Framework.dll".
            PaintDotNet.Data
        D:\Program Files\paint.net\PaintDotNet.SystemLayer.Native.x64.dll
          Project file item includes which caused reference "D:\Program Files\paint.net\PaintDotNet.SystemLayer.Native.x64.dll".
            PaintDotNet.Core
            PaintDotNet.Data    DdsFileTypePlus    C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets    2203    

 

Has anyone else had this issue?

PdnSig.png

Plugin Pack | PSFilterPdn | Content Aware Fill | G'MICPaint Shop Pro Filetype | RAW Filetype | WebP Filetype

The small increase in performance you get coding in C++ over C# is hardly enough to offset the headache of coding in the C++ language. ~BoltBait

 

Link to comment
Share on other sites

  • null54 changed the title to WindowsBase version conflict when building PDN 4.3 plugins

@null54 ILSpy shows me that you're using 4.2.16 libraries for references. This is not a good idea. It'll mostly work but things (methods and stuff) you're using may not be available anymore or their behaviour may be different for some reason.

 

I'd suggest referencing PDN 4.3's libraries to minimize the risk.

 

This is WebP plugin. Same for AvifFileType and DDSFileTypePlus.

 

// Detected TargetFramework-Id: .NETCoreApp,Version=v5.0
// Detected RuntimePack: Microsoft.NETCore.App

// Referenced assemblies (in metadata order):
// PaintDotNet.Base, Version=4.216.7781.39227, Culture=neutral, PublicKeyToken=null
	// Assembly reference loading information:
	// There were some problems during assembly reference load, see below for more information!
	// Error: Could not find reference: PaintDotNet.Base, Version=4.216.7781.39227, Culture=neutral, PublicKeyToken=null

// PaintDotNet.Core, Version=4.216.7781.39227, Culture=neutral, PublicKeyToken=null
	// Assembly reference loading information:
	// There were some problems during assembly reference load, see below for more information!
	// Error: Could not find reference: PaintDotNet.Core, Version=4.216.7781.39227, Culture=neutral, PublicKeyToken=null

// PaintDotNet.Data, Version=4.216.7781.39227, Culture=neutral, PublicKeyToken=null
	// Assembly reference loading information:
	// There were some problems during assembly reference load, see below for more information!
	// Error: Could not find reference: PaintDotNet.Data, Version=4.216.7781.39227, Culture=neutral, PublicKeyToken=null

// System.Collections, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a (unresolved)
// System.ComponentModel, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a (unresolved)
// System.Drawing.Common, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51 (unresolved)
// System.Drawing.Primitives, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a (unresolved)
// System.Linq, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a (unresolved)
// System.Runtime, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a (unresolved)
// System.Runtime.InteropServices, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a (unresolved)
// System.Runtime.InteropServices.RuntimeInformation, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a (unresolved)
// WebP_ARM64.dll
// contains no metadata
// WebP_x64.dll
// contains no metadata
// WebP_x86.dll
// contains no metadata

 

For my plugins, I'm doing it like this in project file. This resolves version conflicts and also helps me to see which things are available (or not) in each version of PDN. Unfortunately I couldn't find an official way to acquire older versions of PDN libraries for backward compatible development purposes. I took a backup before installing 4.3.

 

	<ItemGroup Condition="'$(TargetFramework)'=='net47'">
		<Reference Include="PaintDotNet.Base">
			<HintPath>..\4.2.16 Libs\PaintDotNet.Base.dll</HintPath>
		</Reference>
		<Reference Include="PaintDotNet.Core">
			<HintPath>..\4.2.16 Libs\PaintDotNet.Core.dll</HintPath>
		</Reference>
		<Reference Include="PaintDotNet.Data">
			<HintPath>..\4.2.16 Libs\PaintDotNet.Data.dll</HintPath>
		</Reference>
	</ItemGroup>

	<ItemGroup Condition="'$(TargetFramework)'=='net5.0-windows'">
		<Reference Include="PaintDotNet.Base">
			<HintPath>C:\Program Files\paint.net\PaintDotNet.Base.dll</HintPath>
		</Reference>
		<Reference Include="PaintDotNet.Core">
			<HintPath>C:\Program Files\paint.net\PaintDotNet.Core.dll</HintPath>
		</Reference>
		<Reference Include="PaintDotNet.Data">
			<HintPath>C:\Program Files\paint.net\PaintDotNet.Data.dll</HintPath>
		</Reference>
	</ItemGroup>
Link to comment
Share on other sites

2 hours ago, otuncelli said:

I'd suggest referencing PDN 4.3's libraries to minimize the risk.

 

I received the warning after changing those projects to use the PDN 4.3 libraries.

PdnSig.png

Plugin Pack | PSFilterPdn | Content Aware Fill | G'MICPaint Shop Pro Filetype | RAW Filetype | WebP Filetype

The small increase in performance you get coding in C++ over C# is hardly enough to offset the headache of coding in the C++ language. ~BoltBait

 

Link to comment
Share on other sites

  • 3 weeks later...

Is there the same problem with VS 2019? Wow...

 

In VS 2019, I didn't see this problem. However, for me, this error occurred after installing VS2022 preview, and the compilation was stopped.

 

Is there a definite solution?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...