问题
After I migrated .Net framework version from 4.6.2 to 4.7.2, there was no problem with I run locally. However, when I published to Azure Cloud Services, there should be something wrong so the service bus message moved to DeadLetter Queue. What's wrong is it as I chose osFamily to 6 (Windows Server 2019) already?
If I chose back Windows Server 2016, below error was out during starting the service:
Unhandled Exception: Method not found: ‘Void Microsoft.Azure.KeyVault.KeyVaultClient..ctor(AuthenticationCallback, System.Net.Http.DelegatingHandler[])‘. at Topo.SettingsContext.GetKeyVaultClient(ClientAssertionCertificate assertionCert) at ...
After that, I also tried below method to install .Net framework in WorkerRole manually but still failed: https://docs.microsoft.com/en-us/azure/cloud-services/cloud-services-startup-tasks-common
回答1:
The Net Framwork 4.7.2 is not installed by default on a cloud service.
You can follow this article to install it:
- Install .NET on Azure Cloud Services roles
Basically you will need to:
- Include the Net installer in your project.
- Add a startup task to run the installer as part of the deployment.
来源:https://stackoverflow.com/questions/56577639/after-migrate-net-framework-from-4-6-2-to-4-7-2-azure-cloud-services-is-not-wo