Move libraries to .NET Standard, allowing Xamarin.macOS GUI to compile.

This commit is contained in:
2018-08-27 22:03:20 +01:00
parent d2da31eeab
commit cb138490bc
24 changed files with 153 additions and 49 deletions

View File

@@ -10,7 +10,6 @@
<AssemblyName>DiscImageChef.Devices</AssemblyName>
<ReleaseVersion>$(Version)</ReleaseVersion>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<TargetFramework>net461</TargetFramework>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<Version>4.5.99.1693</Version>
<Company>Claunia.com</Company>
@@ -18,6 +17,7 @@
<Product>The Disc Image Chef</Product>
<Title>DiscImageChef.Devices</Title>
<ApplicationVersion>$(Version)</ApplicationVersion>
<TargetFrameworks>net461;netstandard2.0</TargetFrameworks>
</PropertyGroup>
<PropertyGroup>
<NrtRevisionFormat>$(Version)-{chash:8} built by {mname} in $(Configuration){!:, modified}</NrtRevisionFormat>

View File

@@ -34,7 +34,9 @@ using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
#if !NETSTANDARD2_0
using System.Management;
#endif
using System.Runtime.InteropServices;
using System.Text;
using Microsoft.Win32.SafeHandles;
@@ -66,8 +68,10 @@ namespace DiscImageChef.Devices.Windows
[SuppressMessage("ReSharper", "RedundantCatchClause")]
internal static DeviceInfo[] GetList()
{
// TODO: Any way to fill this in .NET Standard ???
List<string> deviceIDs = new List<string>();
#if !NETSTANDARD2_0
try
{
ManagementObjectSearcher mgmtObjSearcher =
@@ -94,6 +98,7 @@ namespace DiscImageChef.Devices.Windows
return null;
#endif
}
#endif
List<DeviceInfo> devList = new List<DeviceInfo>();