问题
We use the DbProvider from the URL Rewrite Extensibility Samples for allow our rewrite rules to use db values. I'm trying to move this website to an Azure Web App. After deploying to a Windows Azure Web App, I'm getting this error:
HTTP Error 500.50 - URL Rewrite Module Error.
System.IO.FileNotFoundException: Could not load file or assembly
'Microsoft.Web.Iis.Rewrite.Providers, Version=7.1.761.0, Culture=neutral, PublicKeyToken=0545b0627da60a5f'
or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.Web.Iis.Rewrite.Providers, Version=7.1.761.0, Culture=neutral, PublicKeyToken=0545b0627da60a5f'
How do I install what's necessary on the Azure Web App to allow this to work since I can't install the URL Rewrite Extensibility Samples directly, nor would I want to.
回答1:
You can't install something on a Web App unless it's packaged as an Extension (see: https://www.siteextensions.net/). I don't see those providers as being packaged so you'd have to create a package yourself or look for an alternative solution.
Having said this, you could try package the assemblies in a Web App you deploy and see if that works as expected (it's not something I've tried in this exact scenario).
回答2:
It may be hacky, but you could try pulling the DLL and its depencies into your BIN folder and deploy. You don't get the nice UI to manage, but worth a shot.
来源:https://stackoverflow.com/questions/37334133/url-rewrite-provider-on-azure-web-app