【问题标题】:Value cannot be null exception when trying to run Imageresizer尝试运行 Imageresizer 时值不能为空异常
【发布时间】:2019-10-28 13:11:10
【问题描述】:

在尝试使用我的 rest api 插件和这个 url 运行我的 Image Resizer 时出现以下错误:http://localhost:8001/D1900010012059

插件代码可以在这里找到:https://github.com/mikaelekstrom/resizerapiplugin/blob/master/RestAPIImageRetriever.cs

Value cannot be null.
Parameter name: value 
  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

 Exception Details: System.ArgumentNullException: Value cannot be null.
Parameter name: value

Source Error: 


 An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace: 



[ArgumentNullException: Value cannot be null.
Parameter name: value]
   System.String.StartsWith(String value, StringComparison comparisonType) +598
   ImageResizer.Storage.BlobProviderBase.FileExists(String virtualPath, NameValueCollection queryString) +88
   ImageResizer.Plugins.VirtualPathProviderShim.GetVIP(String virtualPath) +217
   ImageResizer.Plugins.VirtualPathProviderShim.FileExists(String virtualPath) +23
   System.Web.Routing.RouteCollection.IsRouteToExistingFile(HttpContextBase httpContext) +120
   System.Web.Routing.RouteCollection.GetRouteData(HttpContextBase httpContext) +129
   System.Web.Routing.UrlRoutingModule.PostResolveRequestCache(HttpContextBase context) +70
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +139
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +195
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +88

【问题讨论】:

    标签: imageresizer


    【解决方案1】:

    您需要在基类上设置VirtualFilesystemPrefix 属性才能为您的类设置路由。您的班级将处理所有前往该前缀的请求。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-03-01
      • 1970-01-01
      • 2018-10-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-05
      相关资源
      最近更新 更多