# HDF.PInvoke: possible to target NET Standard 1.0 or higher instead of targetting only NET Framework 2.0?

**URL:** <https://forum.hdfgroup.org/t/hdf-pinvoke-possible-to-target-net-standard-1-0-or-higher-instead-of-targetting-only-net-framework-2-0/4155>\
**Category:** HDF5 Library\
**Created:** [January 8, 2018, 5:26pm UTC](https://forum.hdfgroup.org/t/hdf-pinvoke-possible-to-target-net-standard-1-0-or-higher-instead-of-targetting-only-net-framework-2-0/4155 "2018-01-08T17:26:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vwilms](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/v/ad7895/32.png) [@vwilms](https://forum.hdfgroup.org/u/vwilms)\
**Post date:** [January 8, 2018, 5:26pm UTC](https://forum.hdfgroup.org/t/hdf-pinvoke-possible-to-target-net-standard-1-0-or-higher-instead-of-targetting-only-net-framework-2-0/4155/1 "2018-01-08T17:26:41Z")

</div>

Dear HDF Team,

I am currently developing a project which uses the new .NET Core framework instead of the "old" .NET Framework. Fortunately it is still possible to include .NET Framework assemblies / NuGet packages in my project. But I get the following warning for each project in my Visual Studio Solution:

NU1701: Package 'HDF.PInvoke 1.10.1' was restored using '.NETFramework,Version=v4.6.1' instead the project target framework '.NETStandard,Version=v2.0'. This may cause compatibility problems.

I just tried to compile the HDF.PInvoke library with netstandard2.0 as target. It seems nothing misses except of the ConfigurationManager class and the Microsoft.VisualStudio.TestTools.UnitTesting namespace which I am pretty sure can be solved with additional NuGet packages.

For my short test I replaced the whole .csproj content with the following XML (Visual Studio 2017 with new csproj format):

\<Project Sdk="Microsoft.NET.Sdk"\>  
&nbsp;&nbsp;\<PropertyGroup\>  
&nbsp;&nbsp;&nbsp;&nbsp;\<TargetFramework\>netstandard2.0\</TargetFramework\>  
&nbsp;&nbsp;&nbsp;&nbsp;\<AllowUnsafeBlocks\>true\</AllowUnsafeBlocks\>  
&nbsp;&nbsp;\</PropertyGroup\>  
\</Project\>

This would allow several frameworks to make use of the HDF.PInvoke NuGet package (and remove the warning). Of course it is still required to run the native libraries on a supported architecture / OS, but at least we are not forced to use the relatively old NET framework. Here is a list of supported platforms, depending on the version of .NET Standard:

> **[.NET Standard](https://learn.microsoft.com/en-us/dotnet/standard/net-standard)**
>
> Learn about .NET Standard, its versions, and the .NET implementations that support it.

Best regards,

Vincent

---

<div class="post-metadata">

**Author:** ![haymo\_kutschbach](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/h/2acd7d/32.png) [@haymo\_kutschbach](https://forum.hdfgroup.org/u/haymo_kutschbach)\
**Post date:** [January 10, 2018, 4:10pm UTC](https://forum.hdfgroup.org/t/hdf-pinvoke-possible-to-target-net-standard-1-0-or-higher-instead-of-targetting-only-net-framework-2-0/4155/2 "2018-01-10T16:10:03Z")

</div>

Hi Vincent,

there is an issue on the HDF/PInvoke github site with a related discussion:

> <https://github.com/HDFGroup/HDF.PInvoke/issues/57>

In short: there seems to be no consensus among the users of HDF/PInvoke,  
whether .NET Standard is the way to go. Please contribute your arguments to  
the discussion!

Btw, .NET Framework is just another runtime of .NET and not considered  
outdated nor deprecated. According to my (unrepresentative) insight among  
ILNumerics customers it is still by far the most popular .NET production  
runtime. This, of course may change once the tooling support for .NET  
Standard / .NET Core is further improving.

Best regards

Haymo

> **···**
>
> --
> 
> -------------------------
> 
> Haymo Kutschbach
> 
> ILNumerics GmbH
> 
> [h.kutschbach@ilnumerics.net](mailto:h.kutschbach@ilnumerics.net)
> 
> ILNumerics GmbH
> 
> Danziger Str. 219
> 
> 10407 Berlin
> 
> Tel: +49 30 4208 7799
> 
> Fax: +49 30 4208 7775
> 
> \<[http://www.ilnumerics.net/](http://www.ilnumerics.net/)\> [http://www.ilnumerics.net](http://www.ilnumerics.net)
> 
> \<[http://twitter.com/ilnumerics](http://twitter.com/ilnumerics)\> [http://twitter.com/ilnumerics](http://twitter.com/ilnumerics)
> 
> Registergericht: Amtsgericht Potsdam
> 
> Registernummer: HRB 26715 P
> 
> Geschäftsführung: Haymo Kutschbach
> 
> From: Hdf-forum [[mailto:hdf-forum-bounces@lists.hdfgroup.org](mailto:hdf-forum-bounces@lists.hdfgroup.org)] On Behalf Of  
> Vincent Wilms  
> Sent: Montag, 8. Januar 2018 18:27  
> To: HDF Users Discussion List  
> Subject: [Hdf-forum] HDF.PInvoke: possible to target NET Standard 1.0 or  
> higher instead of targetting only NET Framework 2.0?
> 
> Dear HDF Team,
> 
> I am currently developing a project which uses the new .NET Core framework  
> instead of the "old" .NET Framework. Fortunately it is still possible to  
> include .NET Framework assemblies / NuGet packages in my project. But I get  
> the following warning for each project in my Visual Studio Solution:
> 
> NU1701: Package 'HDF.PInvoke 1.10.1' was restored using  
> '.NETFramework,Version=v4.6.1' instead the project target framework  
> '.NETStandard,Version=v2.0'. This may cause compatibility problems.
> 
> I just tried to compile the HDF.PInvoke library with netstandard2.0 as  
> target. It seems nothing misses except of the ConfigurationManager class and  
> the Microsoft.VisualStudio.TestTools.UnitTesting namespace which I am pretty  
> sure can be solved with additional NuGet packages.
> 
> For my short test I replaced the whole .csproj content with the following  
> XML (Visual Studio 2017 with new csproj format):
> 
> \<Project Sdk="Microsoft.NET.Sdk"\>  
> &nbsp;&nbsp;\<PropertyGroup\>  
> &nbsp;&nbsp;&nbsp;&nbsp;\<TargetFramework\>netstandard2.0\</TargetFramework\>
> 
> &nbsp;&nbsp;&nbsp;&nbsp;\<AllowUnsafeBlocks\>true\</AllowUnsafeBlocks\>  
> &nbsp;&nbsp;\</PropertyGroup\>  
> \</Project\>
> 
> This would allow several frameworks to make use of the HDF.PInvoke NuGet  
> package (and remove the warning). Of course it is still required to run the  
> native libraries on a supported architecture / OS, but at least we are not  
> forced to use the relatively old NET framework. Here is a list of supported  
> platforms, depending on the version of .NET Standard:
> 
> > **[.NET Standard](https://docs.microsoft.com/en-us/dotnet/standard/net-standard)**
> >
> > Learn about .NET Standard, its versions and the .NET implementations that support it.
> 
> Best regards,
> 
> Vincent

---

<div class="post-metadata">

**Author:** ![vwilms](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/v/ad7895/32.png) [@vwilms](https://forum.hdfgroup.org/u/vwilms)\
**Post date:** [January 17, 2018, 2:25pm UTC](https://forum.hdfgroup.org/t/hdf-pinvoke-possible-to-target-net-standard-1-0-or-higher-instead-of-targetting-only-net-framework-2-0/4155/3 "2018-01-17T14:25:56Z")

</div>

Hi Haymo,

thanks for the hint to the repository, I will follow up the issue you mentioned. I was not trying to say that .NET is outdated but instead that the tight coupling to .NET prevents users from using .NET Core and its new features. In the end I would like to run my software also on Linux, either with or without HDF included (it is just one of several plugins). I saw your arguments against using .NET Standard to avoid the assumption that the library runs on all platforms and hope that instead another solution will be found to have again a clean development experience.

Thanks and best regards,

Vincent

> **···**
>
> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> Von: Hdf-forum \<[hdf-forum-bounces@lists.hdfgroup.org](mailto:hdf-forum-bounces@lists.hdfgroup.org)\> im Auftrag von Haymo Kutschbach \<[h.kutschbach@ilnumerics.net](mailto:h.kutschbach@ilnumerics.net)\>  
> Gesendet: Mittwoch, 10. Januar 2018 17:10  
> An: 'HDF Users Discussion List'  
> Betreff: Re: [Hdf-forum] HDF.PInvoke: possible to target NET Standard 1.0 or higher instead of targetting only NET Framework 2.0?
> 
> Hi Vincent,
> 
> there is an issue on the HDF/PInvoke github site with a related discussion:
> 
> [https://github.com/HDFGroup/HDF.PInvoke/issues/57](https://github.com/HDFGroup/HDF.PInvoke/issues/57)\<[https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FHDFGroup%2FHDF.PInvoke%2Fissues%2F57&data=02|01||af13f93951f34ac451e708d55844e447|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|636511975266016238&sdata=vYkja3i6qtZ8ZcFuCv4wlP6b8BIZInHo0pHhZ5Z%2FfBQ%3D&reserved=0](https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FHDFGroup%2FHDF.PInvoke%2Fissues%2F57&data=02%7C01%7C%7Caf13f93951f34ac451e708d55844e447%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636511975266016238&sdata=vYkja3i6qtZ8ZcFuCv4wlP6b8BIZInHo0pHhZ5Z%2FfBQ%3D&reserved=0)\>
> 
> In short: there seems to be no consensus among the users of HDF/PInvoke, whether .NET Standard is the way to go. Please contribute your arguments to the discussion!
> 
> Btw, .NET Framework is just another runtime of .NET and not considered ‘outdated’ nor deprecated. According to my (unrepresentative) insight among ILNumerics customers it is still by far the most popular .NET production runtime. This, of course may change once the tooling support for .NET Standard / .NET Core is further improving.
> 
> Best regards
> 
> Haymo
> 
> --
> 
> -------------------------
> 
> Haymo Kutschbach
> 
> ILNumerics GmbH
> 
> [h.kutschbach@ilnumerics.net](mailto:h.kutschbach@ilnumerics.net)\<[mailto:h.kutschbach@ilnumerics.net](mailto:h.kutschbach@ilnumerics.net)\>
> 
> ILNumerics GmbH
> 
> Danziger Str. 219
> 
> 10407 Berlin
> 
> Tel: +49 30 4208 7799
> 
> Fax: +49 30 4208 7775
> 
> [http://www.ilnumerics.net](http://www.ilnumerics.net)\<[https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.ilnumerics.net%2F&data=02|01||af13f93951f34ac451e708d55844e447|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|636511975266016238&sdata=PCDSOtipEQcguWOjt%2B1IS%2FDlJcT1tPE0hEK%2BL0fNpx0%3D&reserved=0](https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.ilnumerics.net%2F&data=02%7C01%7C%7Caf13f93951f34ac451e708d55844e447%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636511975266016238&sdata=PCDSOtipEQcguWOjt%2B1IS%2FDlJcT1tPE0hEK%2BL0fNpx0%3D&reserved=0)\>
> 
> [http://twitter.com/ilnumerics](http://twitter.com/ilnumerics)\<[https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Ftwitter.com%2Filnumerics&data=02|01||af13f93951f34ac451e708d55844e447|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|636511975266016238&sdata=EkTEYhmFZjJE1SVvd%2FP2uwBlT6%2Fu9qUasBiSLf8Nd6k%3D&reserved=0](https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Ftwitter.com%2Filnumerics&data=02%7C01%7C%7Caf13f93951f34ac451e708d55844e447%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636511975266016238&sdata=EkTEYhmFZjJE1SVvd%2FP2uwBlT6%2Fu9qUasBiSLf8Nd6k%3D&reserved=0)\>
> 
> Registergericht: Amtsgericht Potsdam
> 
> Registernummer: HRB 26715 P
> 
> Geschäftsführung: Haymo Kutschbach
> 
> From: Hdf-forum [[mailto:hdf-forum-bounces@lists.hdfgroup.org](mailto:hdf-forum-bounces@lists.hdfgroup.org)] On Behalf Of Vincent Wilms  
> Sent: Montag, 8. Januar 2018 18:27  
> To: HDF Users Discussion List  
> Subject: [Hdf-forum] HDF.PInvoke: possible to target NET Standard 1.0 or higher instead of targetting only NET Framework 2.0?
> 
> Dear HDF Team,
> 
> I am currently developing a project which uses the new .NET Core framework instead of the "old" .NET Framework. Fortunately it is still possible to include .NET Framework assemblies / NuGet packages in my project. But I get the following warning for each project in my Visual Studio Solution:
> 
> NU1701: Package 'HDF.PInvoke 1.10.1' was restored using '.NETFramework,Version=v4.6.1' instead the project target framework '.NETStandard,Version=v2.0'. This may cause compatibility problems.
> 
> I just tried to compile the HDF.PInvoke library with netstandard2.0 as target. It seems nothing misses except of the ConfigurationManager class and the Microsoft.VisualStudio.TestTools.UnitTesting namespace which I am pretty sure can be solved with additional NuGet packages.
> 
> For my short test I replaced the whole .csproj content with the following XML (Visual Studio 2017 with new csproj format):
> 
> \<Project Sdk="Microsoft.NET.Sdk"\>  
> &nbsp;&nbsp;\<PropertyGroup\>  
> &nbsp;&nbsp;&nbsp;&nbsp;\<TargetFramework\>netstandard2.0\</TargetFramework\>
> 
> &nbsp;&nbsp;&nbsp;&nbsp;\<AllowUnsafeBlocks\>true\</AllowUnsafeBlocks\>  
> &nbsp;&nbsp;\</PropertyGroup\>  
> \</Project\>
> 
> This would allow several frameworks to make use of the HDF.PInvoke NuGet package (and remove the warning). Of course it is still required to run the native libraries on a supported architecture / OS, but at least we are not forced to use the relatively old NET framework. Here is a list of supported platforms, depending on the version of .NET Standard:
> 
> [https://docs.microsoft.com/en-us/dotnet/standard/net-standard](https://docs.microsoft.com/en-us/dotnet/standard/net-standard)\<[https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fdotnet%2Fstandard%2Fnet-standard&data=02|01||af13f93951f34ac451e708d55844e447|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|636511975266016238&sdata=m86Z3DfuEvdA2JOjCgQqarvBfl%2ByH2GwONxN6dX7DvY%3D&reserved=0](https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fdotnet%2Fstandard%2Fnet-standard&data=02%7C01%7C%7Caf13f93951f34ac451e708d55844e447%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636511975266016238&sdata=m86Z3DfuEvdA2JOjCgQqarvBfl%2ByH2GwONxN6dX7DvY%3D&reserved=0)\>
> 
> Best regards,
> 
> Vincent
