Early .NET Core 3.0 adopters (those targeting WinForms and WPF) might recall that sharing common libraries with the DevExpress.Data or DevExpress.Xpo assemblies is more difficult for the "netcoreapp3.0" and "netstandard2.0" projects.
The good news is that we found a simpler solution - Cross-platform targeting or Multi-Targeting. This approach will help you avoid two CSPROJ files for different Target Frameworks - less code duplication and maintenance costs for your solution. To make it work, the CSPOJ file defines TargetFrameworks element and required dependencies for each target conditions. You can download a working sample from this Support Center ticket (T808990).
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFrameworks>netstandard2.0;netcoreapp3.0</TargetFrameworks> <Description>Sample project that targets multiple TFMs</Description> </PropertyGroup> <ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'"> <PackageReference Include="DevExpress.Xpo" Version="19.2.3" /> </ItemGroup> <ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'"> <PackageReference Include="DevExpress.WindowsDesktop.Xaf" Version="19.2.3-ctp" /> </ItemGroup> </Project>
The sample has the following structure and dependencies:
For more information on .NET Core 3.0 and .NET Standard 2.0 support in XPO, see this documentation topic.
Your Feedback Matters
Are you developing cross-platform libraries like this? If so, please share your thoughts and tell us other about the challenges you’ve encountered.
Are you experimenting with .NET Core 3? We’d love to know more about your experiences and whether you expect to port an existing WinForms and/or WPF app?