Merge pull request #6 from pr8x/net5

Add support for .NET 5
This commit is contained in:
Luis v.d.Eltz
2021-10-01 13:08:58 +02:00
committed by GitHub
9 changed files with 28 additions and 15 deletions
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFrameworks>netcoreapp3.1;net5.0-windows10.0.17763.0</TargetFrameworks>
<Nullable>enable</Nullable>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Description>A cross-platform C# library for native desktop "toast" notifications.</Description>
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFrameworks>netcoreapp3.1;net5.0-windows10.0.17763.0</TargetFrameworks>
<Description>A cross-platform C# library for native desktop "toast" notifications.</Description>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFrameworks>netcoreapp3.1;net5.0-windows10.0.17763.0</TargetFrameworks>
<Nullable>enable</Nullable>
<Description>A cross-platform C# library for native desktop "toast" notifications.</Description>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
@@ -1,4 +1,5 @@
using System.Diagnostics;
using System;
using System.Diagnostics;
using System.IO;
namespace DesktopNotifications.FreeDesktop
@@ -19,6 +20,12 @@ namespace DesktopNotifications.FreeDesktop
public static FreeDesktopApplicationContext FromCurrentProcess(string? appIcon = null)
{
var mainModule = Process.GetCurrentProcess().MainModule;
if (mainModule?.FileName == null)
{
throw new InvalidOperationException("No valid process module found.");
}
return new FreeDesktopApplicationContext(
Path.GetFileNameWithoutExtension(mainModule.FileName),
appIcon
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFrameworks>netcoreapp3.1;net5.0-windows10.0.17763.0</TargetFrameworks>
<Nullable>enable</Nullable>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Description>A cross-platform C# library for native desktop "toast" notifications.</Description>
@@ -11,7 +11,7 @@
<ItemGroup>
<ProjectReference Include="..\DesktopNotifications\DesktopNotifications.csproj" />
<PackageReference Include="Microsoft.Toolkit.Uwp.Notifications" Version="7.0.0" />
<PackageReference Include="Microsoft.Toolkit.Uwp.Notifications" Version="7.0.2" />
</ItemGroup>
</Project>
</Project>
@@ -23,6 +23,12 @@ namespace DesktopNotifications.Windows
string? appUserModelId = null)
{
var mainModule = Process.GetCurrentProcess().MainModule;
if (mainModule?.FileName == null)
{
throw new InvalidOperationException("No valid process module found.");
}
var appName = customName ?? Path.GetFileNameWithoutExtension(mainModule.FileName);
var aumid = appUserModelId ?? appName; //TODO: Add seeded bits to avoid collisions?
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFrameworks>netcoreapp3.1;net5.0-windows10.0.17763.0</TargetFrameworks>
<Nullable>enable</Nullable>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Description>A cross-platform C# library for native desktop "toast" notifications.</Description>
+2 -2
View File
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFrameworks>netcoreapp3.1;net5.0-windows10.0.17763.0</TargetFrameworks>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
+1 -1
View File
@@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFrameworks>netcoreapp3.1;net5.0-windows10.0.17763.0</TargetFrameworks>
<Nullable>enable</Nullable>
</PropertyGroup>