i’m trying to deploy my Minimal API application as a self-contained single executable.
Already managed to get the “wwwroot” outside the package, so it’s ok.
When i open my web page using browser only home is shown. No more links are reachable (Even if the one used by swagger that is ALWAYS enabled).
I’ve seen, when using PublishSingleFile, some functions connected to Assembly do not work properly. (ex. Assembly.Location). Since all the Minimal API is based on Reflection i suppose the problem is there, but i didn’t understand how to figure out.
This is the commandline i use to create the publish:
dotnet publish -c Release -r win-x64 /p:DebugType=None /p:DebugSymbols=false -p:PublishSingleFile=true --self-contained true -p:CopyOutputSymbolsToPublishDirectory=false
If i remove the PublishSingleFile flag (or set it as false) it works like a charm
I suppose the killing function is “builder.Services.AddEndpointsApiExplorer();”
Any ideas?
Thanks
Tried without PublishSingleFile flag: works
Tried with PublishSingleFile flag set to TRUE: does not work
Expected: it should work always