Unable to load System.ServiceModel.Primitives on Azure Web App slot

Goncalo Oliveira 1 Reputation point
2021-09-01T16:11:37.027+00:00

I'm having issues with one of the slots of an Web App (Linux). The slot is configured to build and deploy from a git repository. The project itself is an ASPNET with .NET 5. This project references a library (also .NET 5) that communicates with a WCF service, and therefore, it references the following packages

<PackageReference Include="System.ServiceModel.Duplex" Version="4.8.1" />
<PackageReference Include="System.ServiceModel.Http" Version="4.8.1" />
<PackageReference Include="System.ServiceModel.NetTcp" Version="4.8.1" />
<PackageReference Include="System.ServiceModel.Primitives" Version="4.8.1" />
<PackageReference Include="System.ServiceModel.Security" Version="4.8.1" />

All of the sudden, I am getting errors after deploying the application, when requesting an endpoint

Could not load file or assembly 'System.ServiceModel.Primitives, Version=4.8.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.

After inspection with SSH, the file is there, along with the others.

The thing is... if I create a new slot, pointing to the same repo, same branch... it builds, deploys and it works... but this slot, for some reason, is stuck and there's something wrong with it!

I could, of course, delete this slot and create a new one, but there are settings, custom domains and certificates... so I'd rather not have to redo all of that!

Any suggestions?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,963 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. ajkuma 22,526 Reputation points Microsoft Employee
    2021-09-02T10:14:44.84+00:00

    @Goncalo Oliveira ,

    Thanks for reporting and sharing a detailed description of this issue. I understand you have isolated the issue and a new slot works as expected.

    Just to highlight, some configuration elements follow the content across a swap (not slot specific), whereas other configuration elements stay in the same slot after a swap (slot specific). -Example - Always On settings is Slot specific.

    --App settings (can be configured to stick to a slot) - make it not sticky/clone and check.

    With Deployment slots on App Service, they are live apps with their own hostnames. You have different versions of your web app to different URLs. You can test a certain version and then swap content and configuration between slots.
    -- Based on your scenario - You may review the matching configuration/clone the settings as well/restart the WebApp and test.

    Kindly see the doc section ‘Settings that aren't swapped’.

    Note: With clone configuration from any existing slot. Settings that can be cloned include app settings, connection strings, language framework versions, web sockets, HTTP version, and platform bitness.

    Kindly let us know how it goes, I’ll follow-up with you further and would need some more details about your WebApp and subscription (for which I’ll reach out you privately).