C
C#3w ago
Natashi

Missing dll on Azure App Service deployment

I'm trying to deploy my web API to Azure App Service, using code deployment to Linux server from GitHub actions The solution has this structure (not its actual solution name, I can't reveal that part)
/AppAPI
AppAPI.sln
/Api
Api.csproj
/Data
Data.csproj
/AppAPI
AppAPI.sln
/Api
Api.csproj
/Data
Data.csproj
(Yes, weird, I know, but I can't change it now) The solution builds and deploys to AAS just fine, but gives this error in the logs: The application 'AppAPI.dll' does not exist. Which is not correct as the publish output assemblies are Api.dll and Data.dll Then, I went to the configuration panel and added dotnet Api.dll as the startup command, and re-ran the app, which then gives me: The application 'Api.dll' does not exist. Opening AAS's host SSH console shows that Api.dll does exist in ~/site/wwwroot (which also looks identical to the local publish output), so I truly have no idea what is happening, and would greatly appreciate any help
No description
20 Replies
Natashi
NatashiOP3w ago
The log stream (image #1) and the last few lines of the docker logs at /api/vfs/LogFiles (image #2)
No description
No description
Unknown User
Unknown User3w ago
Message Not Public
Sign In & Join Server To View
Natashi
NatashiOP3w ago
Docker isn't used, I'm using the deploy code option rather than deploy container The deploy job is as so
deploy-api:
name: Deploy App Service
runs-on: ubuntu-latest

env:
APP_NAME: 'app-api'
DIR_PROJ: ./AppAPI

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Build and publish
working-directory: ${{ env.DIR_PROJ }}
run: |
dotnet restore
dotnet build --configuration Release
dotnet publish -c Release -o publish

- name: Login to Azure
uses: azure/login@v2
with:
creds: ${{ secrets.AZURE_DEPLOY_CREDENTIALS }}

- name: Azure deploy
id: deploy-to-webapp
uses: azure/webapps-deploy@v3
with:
app-name: ${{ env.APP_NAME }}
package: ${{ env.DIR_PROJ }}/publish
deploy-api:
name: Deploy App Service
runs-on: ubuntu-latest

env:
APP_NAME: 'app-api'
DIR_PROJ: ./AppAPI

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Build and publish
working-directory: ${{ env.DIR_PROJ }}
run: |
dotnet restore
dotnet build --configuration Release
dotnet publish -c Release -o publish

- name: Login to Azure
uses: azure/login@v2
with:
creds: ${{ secrets.AZURE_DEPLOY_CREDENTIALS }}

- name: Azure deploy
id: deploy-to-webapp
uses: azure/webapps-deploy@v3
with:
app-name: ${{ env.APP_NAME }}
package: ${{ env.DIR_PROJ }}/publish
Unknown User
Unknown User3w ago
Message Not Public
Sign In & Join Server To View
Natashi
NatashiOP3w ago
Yeah, it's net6, but AAS still has an option for it and the runtime exists as normal
MODiX
MODiX3w ago
TeBeCo
run dotnet --info on the app service
React with ❌ to remove this embed.
Natashi
NatashiOP3w ago
No description
Natashi
NatashiOP3w ago
If I run dotnet Api.dll on the server console there, it does run properly by the way (except for the fact that it crashes because I forgot to allow the app through the database firewall)
Unknown User
Unknown User3w ago
Message Not Public
Sign In & Join Server To View
Natashi
NatashiOP3w ago
I did nothing and it suddenly worked, I don't even know anymore
Natashi
NatashiOP3w ago
No description
Unknown User
Unknown User3w ago
Message Not Public
Sign In & Join Server To View
Natashi
NatashiOP3w ago
Initial deployments always had this issue, but at one point it started working (with unrelated errors, see https://discord.com/channels/143867839282020352/156079822454390784/1314127421464772678), but then somehow it regressed and no longer worked
MODiX
MODiX3w ago
Natashi
Deploying my web API to Azure App Service is giving me this in the logs:
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.EntityFrameworkCore.Relational, Version=7.0.20.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.EntityFrameworkCore.Relational, Version=7.0.20.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.
My current hypothesis is that it's caused by the app running on .NET 6, but using EF Core packages at version 7.0.x, if so, any ideas on how to fix this short of upgrading the .NET version?
Quoted by
<@188850307629842432> from #web (click here)
React with ❌ to remove this embed.
Natashi
NatashiOP3w ago
and now currently it's working again, I truly have to idea what the fresh hell is happening here
Unknown User
Unknown User3w ago
Message Not Public
Sign In & Join Server To View
Natashi
NatashiOP3w ago
Yes, I've already downgraded everything to 6.0.x
Unknown User
Unknown User3w ago
Message Not Public
Sign In & Join Server To View
Natashi
NatashiOP3w ago
The deadline is next month, and that includes internal testing, I can't upgrade to the next major version right now
Unknown User
Unknown User3w ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server