国产精品久久国产精麻豆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í),本站將立刻刪除。

把极品白丝班长啪到腿软| 校草被两个混混脱裤玩j| 久久久久免费毛a片免费一瓶梅 | 亚洲色欲色欲在线大片| 精品国产午夜肉伦伦影院| 亚洲午夜成人精品无码色欲| 公交车上荫蒂添的好舒服小说| 精品人妻无码一区二区色欲产成人 | 久久精品一区二区三区中文字幕| 两个人在线观看视频| 亚洲色大成www亚洲女子| 日本欧美久久久久免费播放网| 久久久无码精品国产一区| 久久精品99久久香蕉国产色戒 | 一二三四在线观看免费高清| 最近中文字幕MV在线资源| 亚洲2022国产成人精品无码区| wwxx在线观看免费| 国产av精品国语对白国产| 无人在线完整免费高清观看| 天天躁日日躁狠狠躁视频2021| 人人妻人人澡人人爽精品欧美| 亲嘴扒胸摸屁股激烈网站| 国产又爽又粗又猛的视频| 久久av高潮av无码av| 九九精品国产亚洲av日韩| 办公室风雨全文阅读| 亚洲中文久久精品无码 | 综影视之被各种男人啪h| av无码国产精品午夜a片| 熟睡人妻被讨厌的公侵犯深田咏美| 男女免费观看做爰视频在线观看 | 精品一区二区三区免费毛片w| 乳尖乱颤娇喘连连a片在线观看 | 我的初次内射欧美成人影视| 国产中老年妇女精品| 短篇公车高h肉辣全集目录| 人妻丰满熟妇av无码区app| 少妇乱子伦精品无码| 最近最新中文字幕完整版免费高清| 99久久国产露脸国语对白 |