I have a problem using a self-contained deployment with .net8.0 on IIS.
Everythink was OK using .net6.0 (even if i just have .net3.1 installed on the server).
I still build my project using --self-contained true
My package seems OK, the web config seems to be OK (it uses processPath=".\MyWebApi.exe" as before).
I have 403 items (133MB) in the wwwroot folder and a DDL named aspnetcorev2_inprocess.dll (v18.0).
But the app won't start.
I have this error on the browser : HTTP Error 500.31 - ANCM Failed to Find Native Dependencies
And I found this error in the event log : Could not find 'aspnetcorev2_inprocess.dll'. Exception message: You must install or update .NET to run this application.
But I don't want to install the framework ! that's why I use the self-contained flag !
Update day+1 :
- I just reinstalled the last ".Net Hosting Bundle" but get the same problem.
- I discovered that if i create the package from my VS myself (Right click, Publish, the package deployment works. There is something wrong with my package. I publish it as before with this existing command on my Pipeline :
dotnet publish MyWebApi.csproj --no-build --no-restore --configuration Release --runtime win-x64 --self-contained true /p:PublishProfile=Release
Update day+2 :
- I fixed the error by removing the
--no-build flag when publishing ! Why ? no documentation helps to understand this !?
Any help ?