Skip to content
This repository was archived by the owner on Sep 29, 2025. It is now read-only.

Commit 2e43937

Browse files
committed
Add application manifest & Fix main entry duplication issue
1 parent 9adacdc commit 2e43937

2 files changed

Lines changed: 59 additions & 2 deletions

File tree

AutoPowerTimeOut.csproj

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
<PropertyGroup>
44
<OutputType>WinExe</OutputType>
55
<TargetFramework>net9.0-windows10.0.19041.0</TargetFramework>
6-
<Nullable>enable</Nullable>
76
<UseWPF>true</UseWPF>
87
<UseWindowsForms>true</UseWindowsForms>
8+
<StartupObject>AutoPowerTimeOut.App</StartupObject>
9+
<ApplicationManifest>app.manifest</ApplicationManifest>
910
<ApplicationIcon>icon.ico</ApplicationIcon>
1011
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
11-
</PropertyGroup>
12+
<Nullable>enable</Nullable>
13+
</PropertyGroup>
1214

1315
<PropertyGroup>
1416
<Title>Auto Power Time-out</Title>
@@ -21,6 +23,14 @@
2123
<FileVersion>1.0.2.2</FileVersion>
2224
</PropertyGroup>
2325

26+
<ItemGroup>
27+
<ApplicationDefinition Remove="App.xaml" />
28+
</ItemGroup>
29+
30+
<ItemGroup>
31+
<Page Include="App.xaml" />
32+
</ItemGroup>
33+
2434
<ItemGroup>
2535
<Content Include="icon.ico" />
2636
<Content Include="icon.png">

app.manifest

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
3+
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
4+
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
5+
<security>
6+
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
7+
<!-- UAC Manifest Options
8+
If you want to change the Windows User Account Control level replace the
9+
requestedExecutionLevel node with one of the following.
10+
11+
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
12+
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
13+
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
14+
15+
Specifying requestedExecutionLevel element will disable file and registry virtualization.
16+
Remove this element if your application requires this virtualization for backwards
17+
compatibility.
18+
-->
19+
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
20+
</requestedPrivileges>
21+
</security>
22+
</trustInfo>
23+
24+
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
25+
<application>
26+
<!-- A list of the Windows versions that this application has been tested on and is
27+
is designed to work with. Uncomment the appropriate elements and Windows will
28+
automatically selected the most compatible environment. -->
29+
30+
<!-- Windows 10 -->
31+
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
32+
33+
</application>
34+
</compatibility>
35+
36+
<!-- Indicates that the application is DPI-aware and will not be automatically scaled by Windows at higher
37+
DPIs. Windows Presentation Foundation (WPF) applications are automatically DPI-aware and do not need
38+
to opt in. Windows Forms applications targeting .NET Framework 4.6 that opt into this setting, should
39+
also set the 'EnableWindowsFormsHighDpiAutoResizing' setting to 'true' in their app.config. -->
40+
<application xmlns="urn:schemas-microsoft-com:asm.v3">
41+
<windowsSettings>
42+
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
43+
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2, PerMonitor</dpiAwareness>
44+
</windowsSettings>
45+
</application>
46+
47+
</assembly>

0 commit comments

Comments
 (0)