C
C#2y ago
SR1909

✅ EXE from MAUI

I made a program with MAUI. It runs with VS fine, but now I want to install this program on another computer. I think I need an EXE or some sort of executable. How to I do this? Did some research, could not find a working solution.
12 Replies
Angius
Angius2y ago
You need to publish your app
SR1909
SR1909OP2y ago
@Angius tried to, got a folder with 282 items... most are .dll files
Angius
Angius2y ago
$singlefile
MODiX
MODiX2y ago
dotnet publish -c Release -r <runtime identifier> -p:PublishSingleFile=true Use of -r|--runtime implies --self-contained true. Add --self-contained false to publish as runtime-dependent. -r RID and -p:PublishSingleFile=true can be moved to .csproj as the following properties:
<RuntimeIdentifier>RID</RuntimeIdentifier>
<PublishSingleFile>true</PublishSingleFile>
<RuntimeIdentifier>RID</RuntimeIdentifier>
<PublishSingleFile>true</PublishSingleFile>
but to target multiple RIDs, you have to use dotnet publish with the -r option for each RID. You can also add -p:IncludeNativeLibrariesForSelfExtract=true to include native libraries (like Common Language Runtime dlls) in the output executable. You might want to instead publish your application compiled Ahead Of Time to native code, see $nativeaot. https://docs.microsoft.com/en-us/dotnet/core/deploying/single-file https://docs.microsoft.com/en-us/dotnet/core/rid-catalog https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-publish
Create a single file for application deployment - .NET
Learn what single file application is and why you should consider using this application deployment model.
.NET Runtime Identifier (RID) catalog
Learn about the Runtime Identifier (RID) and how RIDs are used in .NET.
Angius
Angius2y ago
This will be of use, then
SR1909
SR1909OP2y ago
That is something I haven't tried yet. I am going to try it now, thanks for the quick response! @Angius Seems to be not possible on MAUI projects for some reason
Monsieur Wholesome
@Angius MAUI projects cannot be published into a folder They are Microsoft-Store only
sibber
sibber2y ago
the default is packaged (to msix) you can build unpackaged
SR1909
SR1909OP2y ago
@Angius @Cyberrex @OneWholesomeDev Thank you all for the help! I think the last github link will be the solution!
sibber
sibber2y ago
np /close when youre done :)
Accord
Accord2y ago
Closed!
Want results from more Discord servers?
Add your server