Skip to content

Commit

Permalink
Add .net 7 target back; enables aot publish for demo project
Browse files Browse the repository at this point in the history
  • Loading branch information
ryancheung committed Mar 13, 2024
1 parent a377590 commit 372ed83
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 3 deletions.
13 changes: 11 additions & 2 deletions ImeSharp.Demo/ImeSharp.Demo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,22 @@

<ItemGroup>
<ProjectReference Include="..\ImeSharp\ImeSharp.csproj" />
<!--<PackageReference Include="Microsoft.DotNet.ILCompiler" Version="7.0.0-*" />-->
</ItemGroup>

<ItemGroup>
<PackageReference Include="WinFormsComInterop" Version="0.4.3" />
</ItemGroup>

<ItemGroup>
<RdXmlFile Include="rd.xml" />
</ItemGroup>

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0-windows</TargetFramework>
<TargetFramework>net7.0-windows</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
<PublishAot>true</PublishAot>
<_SuppressWinFormsTrimError>true</_SuppressWinFormsTrimError>
</PropertyGroup>

</Project>
3 changes: 3 additions & 0 deletions ImeSharp.Demo/Program.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using System.Windows.Forms;

Expand All @@ -14,6 +15,8 @@ static class Program
[STAThread]
static void Main()
{
ComWrappers.RegisterForMarshalling(WinFormsComInterop.WinFormsComWrappers.Instance);

//Application.SetHighDpiMode(HighDpiMode.SystemAware);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Expand Down
40 changes: 40 additions & 0 deletions ImeSharp.Demo/rd.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8" ?>
<Directives>
<Application>
<Assembly Name="System.Resources.Extensions">
<Type Name="System.Resources.Extensions.RuntimeResourceSet" Dynamic="Required All" />
<Type Name="System.Resources.Extensions.DeserializingResourceReader" Dynamic="Required All" />
</Assembly>
<Assembly Name="System.Drawing">
<Type Name="System.Drawing.Bitmap" Dynamic="Required All" />
</Assembly>
<Assembly Name="System.Windows.Forms">
<Type Name="System.Windows.Forms.PropertyGridInternal.PropertiesTab" Dynamic="Required All" />
<Type Name="System.Windows.Forms.DataGridViewColumn" Dynamic="Required All" />

<Type Name="System.Windows.Forms.DataGridViewButtonColumn" Dynamic="Required All" />
<Type Name="System.Windows.Forms.DataGridViewComboBoxColumn" Dynamic="Required All" />
<Type Name="System.Windows.Forms.DataGridViewCheckBoxColumn" Dynamic="Required All" />
<Type Name="System.Windows.Forms.DataGridViewImageColumn" Dynamic="Required All" />
<Type Name="System.Windows.Forms.DataGridViewLinkColumn" Dynamic="Required All" />
<Type Name="System.Windows.Forms.DataGridViewTextBoxColumn" Dynamic="Required All" />

<Type Name="System.Windows.Forms.DataGridViewButtonCell" Dynamic="Required All" />
<Type Name="System.Windows.Forms.DataGridViewComboBoxCell" Dynamic="Required All" />
<Type Name="System.Windows.Forms.DataGridViewCheckBoxCell" Dynamic="Required All" />
<Type Name="System.Windows.Forms.DataGridViewHeaderCell" Dynamic="Required All" />
<Type Name="System.Windows.Forms.DataGridViewImageCell" Dynamic="Required All" />
<Type Name="System.Windows.Forms.DataGridViewLinkCell" Dynamic="Required All" />
<Type Name="System.Windows.Forms.DataGridViewRowHeaderCell" Dynamic="Required All" />
<Type Name="System.Windows.Forms.DataGridViewTextBoxCell" Dynamic="Required All" />
<Type Name="System.Windows.Forms.DataGridViewTopLeftHeaderCell" Dynamic="Required All" />

<Type Name="System.Windows.Forms.DataGridViewComboBoxEditingControl" Dynamic="Required All" />
<Type Name="System.Windows.Forms.DataGridViewTextBoxEditingControl" Dynamic="Required All" />

<Type Name="System.Windows.Forms.RadioButton" Dynamic="Required All" />
</Assembly>
<Assembly Name="TsfSharp" Dynamic="Required All">
</Assembly>
</Application>
</Directives>
2 changes: 1 addition & 1 deletion ImeSharp/ImeSharp.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net46;netstandard2.0;netcoreapp3.1;net8.0</TargetFrameworks>
<TargetFrameworks>net46;netstandard2.0;netcoreapp3.1;net7.0;net8.0</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

Expand Down

0 comments on commit 372ed83

Please sign in to comment.