最近用visual studio 2022寫好了一個VB.NET的程式,按建置後會出現許多DLL檔、一個EXE檔還有一些其他雜檔,上網GOOGLE後使用了Costura.Fody,例如原本結果會有10個DLL檔+1個EXE,使用Costura.Fody結果變成1個DLL與1個EXE(只拉EXE出來是不能用的),我該如何將DLL包進EXE內呢?
有試過使用dotnet publish成功打包成一個EXE,但原本EXE+DLL也才不到10MB,用dotnet publish卻變成100多MB...
如果是.NET,發布的時候,目標執行階段選擇64位元,底下會出現檔案發行選項,裡面有一個是產生單一檔案,然後就會只有一個EXE與.pdb檔案,pdb可以不理他
dotnet publish會變成很大是因為你把.NET的所有函數庫都包進去了,好處是使用者不用安裝runtime,前者檔案比較小,但是使用者需要安裝runtime
Thanks for the tips! Choosing the right publishing options can make a huge difference in the user experience. I appreciate the explanation about the trade-offs between a single EXE and the runtime installation. It’s definitely a consideration block blast for ensuring ease of deployment!