【发布时间】:2023-04-08 11:39:02
【问题描述】:
我正在尝试在共享托管环境中的 MVC 应用程序中使用 DevTrends Donut Caching。
当我上传应用程序时出现此错误:
System.Security.SecurityException: MvcDonutCaching 没有 读取 web.config 部分“OutputCacheSettingsSection”的权限。
主机提供商表示此限制是由于中等信任环境造成的。
虽然我没有足够的知识来反驳这一点,但在中等信任下基本 Web.Config 设置不可用似乎很奇怪/不合理。
另外,在 this workitem 的底部,从 2012 年开始,作者声明:
我添加了一些代码以允许在严格的条件下使用 MvcDonutCaching 中等信任环境
我应该能够在中等信任环境中访问这些设置吗?
我在 web.config 中使用的缓存设置是这样的:
<system.web>
<caching>
<outputCacheSettings>
<outputCacheProfiles>
<add name="CacheFor1Hour" duration="3600" varyByParam="none" />
<add name="RecacheOnUpdate" duration="2419200" varyByParam="*" />
<add name="Dashboard" duration="86400" varyByParam="*" varyByCustom="User" location="Server" />
</outputCacheProfiles>
</outputCacheSettings>
</caching>
</system.web>
【问题讨论】:
标签: asp.net-mvc web-config outputcache medium-trust