An old question, but if someone lands on it, then the following should work:
In your case, add / update the staticContent element:
This is an alternative solution, so you will not use the .transform file, but rather web.config.install.xdt (and web.config.uninstall.xdt), which I find better:
<?xml version="1.0"?> <configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> <staticContent xdt:Transform="InsertIfMissing"> <mimeMap fileExtension=".webp" mimeType="image/webp" xdt:Locator="Match(fileExtension)" xdt:Transform="InsertIfMissing" /> </staticContent> </configuration>
Thus, you do not need to make preliminary updates, just update the package.
Check out this post for XDT support from Nuget 2.6 onwards.
source share