国产精品久久国产精麻豆99网站,激烈18禁高潮视频免费,老师含紧一点h边做边走视频动漫,双乳被一左一右的吸着

C#Aot發(fā)布Winform應(yīng)用秒變?cè)绦蚯也恍枰狽ET環(huán)境運(yùn)行(cctv5節(jié)目表)

自從NET7發(fā)布以來。官方并沒有放棄winform。任然繼續(xù)維護(hù)。

傳統(tǒng)NET F發(fā)布程序。首先需要NET環(huán)境。被各種吐槽。發(fā)布一個(gè)應(yīng)用2MB,結(jié)果客戶需要安裝一個(gè)百M(fèi)B的NET環(huán)境。現(xiàn)在NET7中已經(jīng)得到很大改善。單發(fā)布應(yīng)用也可以直接將環(huán)境一起發(fā)布。發(fā)給客戶使用時(shí)候。直接運(yùn)行,不需要客戶安裝NET環(huán)境。

現(xiàn)在介紹一個(gè)更好的方法。winform程序 AOT發(fā)布。發(fā)布后和原生APP一樣。直接將IL代碼編譯成原生應(yīng)用。不但免NET環(huán)境運(yùn)行,且和C/C 發(fā)布程序相似,得到了很快的運(yùn)行速度。一個(gè)原生EXE。速度性能等得到大幅度提升。

注意此方法是官方推薦,但并非官方發(fā)布。發(fā)布后需要測試。

一.新建一個(gè)winform項(xiàng)目。選NET7。

生成后如下。

<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>WinExe</OutputType> <TargetFramework>net7.0-windows</TargetFramework> <Nullable>enable</Nullable> <UseWindowsForms>true</UseWindowsForms> <ImplicitUsings>enable</ImplicitUsings> </PropertyGroup></Project>

對(duì)上面的內(nèi)容改動(dòng)。增加AOT。

1.nuget 添加 WinFormsComInterop。此包是發(fā)布AOT前提。

然后改動(dòng) csproj 項(xiàng)目內(nèi)容。完整如下。

<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>WinExe</OutputType> <TargetFramework>net7.0-windows</TargetFramework> <Nullable>enable</Nullable> <UseWindowsForms>true</UseWindowsForms> <ImplicitUsings>enable</ImplicitUsings> <PublishAot>true</PublishAot> <_SuppressWinFormsTrimError>true</_SuppressWinFormsTrimError> <AllowUnsafeBlocks>True</AllowUnsafeBlocks> <CustomResourceTypesSupport>true</CustomResourceTypesSupport> </PropertyGroup> <ItemGroup> <RdXmlFile Include="rd.xml" /> </ItemGroup> <ItemGroup> <PackageReference Include="WinFormsComInterop" Version="0.4.3" /> </ItemGroup></Project>

PublishAot :程序啟動(dòng)AOT發(fā)布。注意 只有NET7以上有效。

_SuppressWinFormsTrimError:抑制WinForms修剪錯(cuò)誤。若不添加WinFormsComInterop包此項(xiàng)是無效的。添加這個(gè)后便winform程序編譯器不會(huì)報(bào)錯(cuò)誤不可修建。此屬于必須。

AllowUnsafeBlocks:允許不安全的塊

CustomResourceTypesSupport:自定義資源類型支持。此項(xiàng)很重要。程序中添加圖標(biāo),圖檔等沒有這項(xiàng)會(huì)報(bào)錯(cuò)。

RdXmlFile:添加rd描述文件,此項(xiàng)很重要。幫助編譯器修剪。

下面貼出完整。使用期間根據(jù)自己開發(fā)需求添加

<?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" /> <Type Name="System.Drawing.Icon" 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" /> <Type Name="System.Windows.Forms.RichTextBox" Dynamic="Required All" /> </Assembly> </Application></Directives>

以上準(zhǔn)備工作完成后,對(duì)啟動(dòng)程序修改。

改動(dòng)Program.cs 中的代碼 增添一下內(nèi)容

ComWrappers.RegisterForMarshalling(WinFormsComInterop.WebView2.WebView2ComWrapper.Instance);

using System.Runtime.InteropServices;namespace TestAotApp{ internal static class Program { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { // To customize application configuration such as set high DPI settings or default font, // see https://aka.ms/applicationconfiguration. ComWrappers.RegisterForMarshalling(WinFormsComInterop.WebView2.WebView2ComWrapper.Instance); ApplicationConfiguration.Initialize(); Application.Run(new Form1()); } }}

到此,全部改造完成。

現(xiàn)在生成的程序便可以AOT發(fā)布了。

C#Aot發(fā)布Winform應(yīng)用秒變?cè)绦蚯也恍枰狽ET環(huán)境運(yùn)行(cctv5節(jié)目表)

隨機(jī)布局。調(diào)試啟動(dòng)成功。

添加發(fā)布

C#Aot發(fā)布Winform應(yīng)用秒變?cè)绦蚯也恍枰狽ET環(huán)境運(yùn)行(cctv5節(jié)目表)

如下改動(dòng)

C#Aot發(fā)布Winform應(yīng)用秒變?cè)绦蚯也恍枰狽ET環(huán)境運(yùn)行(cctv5節(jié)目表)

完成發(fā)布后目錄下生成如下文件。

C#Aot發(fā)布Winform應(yīng)用秒變?cè)绦蚯也恍枰狽ET環(huán)境運(yùn)行(cctv5節(jié)目表)

C#Aot發(fā)布Winform應(yīng)用秒變?cè)绦蚯也恍枰狽ET環(huán)境運(yùn)行(cctv5節(jié)目表)

C#Aot發(fā)布Winform應(yīng)用秒變?cè)绦蚯也恍枰狽ET環(huán)境運(yùn)行(cctv5節(jié)目表)

啟動(dòng)成功。目標(biāo)目錄下附帶很多Dll文件,我接下來測試發(fā)現(xiàn)將程序復(fù)制到win7環(huán)境,并不需要復(fù)制dll文件也能順利啟動(dòng)。

C#Aot發(fā)布Winform應(yīng)用秒變?cè)绦蚯也恍枰狽ET環(huán)境運(yùn)行(cctv5節(jié)目表)

復(fù)制程序到win7環(huán)境順利運(yùn)行。

通過以上改動(dòng),一個(gè)NET7開發(fā)的程序使用AOT發(fā)布完成。若是用此方法開發(fā)一些小工具簡直太方便了。若是發(fā)布后感覺文件很大,完全可以用upx壓縮.依然有效。

C#Aot發(fā)布Winform應(yīng)用秒變?cè)绦蚯也恍枰狽ET環(huán)境運(yùn)行(cctv5節(jié)目表)

最后我們把程序拖動(dòng)到ILspy中發(fā)現(xiàn)看不到任何內(nèi)容。

至此確確實(shí)實(shí)是一個(gè)windows原生程序應(yīng)用。是不是很好。

若需要測試源碼。留言評(píng)論?;蛘甙l(fā)私信給我。

C#Aot發(fā)布Winform應(yīng)用秒變?cè)绦蚯也恍枰狽ET環(huán)境運(yùn)行(cctv5節(jié)目表)

版權(quán)聲明:本文內(nèi)容由互聯(lián)網(wǎng)用戶自發(fā)貢獻(xiàn),該文觀點(diǎn)僅代表作者本人。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如發(fā)現(xiàn)本站有涉嫌抄襲侵權(quán)/違法違規(guī)的內(nèi)容, 請(qǐng)發(fā)送郵件至 舉報(bào),一經(jīng)查實(shí),本站將立刻刪除。

我的初次内射欧美成人影视| 精产国品一二三产品区别在线 | 色综合99久久久无码国产精品| 国产视频在线观看| 亚洲爆乳无码一区二区三区| 强壮的公次次弄得我高潮a片小说 免费看国产曰批40分钟 | 西西人体扒开大胆大尺度展露| 囗交姿势图3d效果展示图| 久久综合狠狠综合久久| 蜜臀av免费一区二区三区| 最近日本mv字幕免费观看视频| 丁香激情综合久久伊人久久| 人妻丰满熟妞AV无码区| 人妻少妇啊灬啊灬用力啊快| 厨房里征服美艳老师| 亚洲欧美日韩一区在线观看| 色欲精品国产一区二区三区| 日本熟妇xxxx乱| 国产av国产精品白丝jk制服| 在熟睡夫面前侵犯我在线播放| 久久精品熟女亚洲av麻豆| 午夜香吻免费观看视频在线播放| 玩弄了裸睡少妇人妻野战| 图片区小说区激情区偷拍区| 国产乱国产乱老熟300部| 欧美一区二区三区放荡人妇| 黑人猛挺进小莹的体内视频| 玩弄了裸睡少妇人妻野战| 激烈18禁高潮视频免费| 再深点灬舒服灬太大了视频| 久久天天躁狠狠躁夜夜av| 性色av网站| 国产精品无码久久综合网| 精品久久久久久中文字幕无码软件| 国产超a级动作大片中文字幕 | 高h短篇辣肉各种姿势自慰h | 天天爽夜夜爽人人爽| 男男开荤粗肉np尿在里面| 日本无翼乌邪恶彩色大全| 久久久精品一区aaa片| 中文字幕人成无码人妻|