smourier / DirectN

Direct interop Code for .NET Framework, .NET Core and .NET 5+ : DXGI, WIC, DirectX 9 to 12, Direct2D, Direct Write, Direct Composition, Media Foundation, WASAPI, CodecAPI, GDI, Spatial Audio, DVD, Windows Media Player, UWP DXInterop, WinUI3, etc.
MIT License
311 stars 28 forks source link

Package DirectNCore 1.9.1 is not compatible with net5.0 #16

Closed viktoraskas closed 2 years ago

viktoraskas commented 2 years ago

Hi,

I have tried to add DirectNCore to my console app but getting this error:

Install-Package : NU1202: Package DirectNCore 1.9.1 is not compatible with net5.0 (.NETCoreApp,Version=v5.0). Package DirectNCore 1.9.1 supports: net5.0-windows8.0 (.NETCoreApp,Version=v5.0)

smourier commented 2 years ago

Hi,

Before you can install DirectNCore in a .NET Core / .NET5+ project, you must update your csproj and make sure your use a TargetFrameworkelement that is at least for Windows 8, so for example:

before:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net5.0</TargetFramework>
  </PropertyGroup>
  ...
</Project>

after:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net5.0-windows10.0.19041.0</TargetFramework>
  </PropertyGroup>
  ...
</Project>
viktoraskas commented 2 years ago

thanks