c# - 找不到方法 : 'System. 字符串 RazorEngine.Templated.ITemplate.Run

标签 c# azure azure-mobile-services razorengine

我正在尝试新的 Azure 移动应用程序。在 Azure 中创建实例,然后下载 Visual Studio 包。通过 Nuget 更新了所有组件。现在,当我运行它时,出现以下错误:

<Error><Message>An error has occurred.</Message><ExceptionMessage>Method not found: 'System.String RazorEngine.Templating.ITemplate.Run(RazorEngine.Templating.ExecuteContext)'.</ExceptionMessage><ExceptionType>System.MissingMethodException</ExceptionType><StackTrace>   at Microsoft.Azure.Mobile.Server.Content.HtmlActionResult.ExecuteAsync(CancellationToken cancellationToken)
at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.AuthenticationFilterResult.<ExecuteAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()</StackTrace></Error>

发现另一篇文章建议升级 Windows Azure 移动服务,我已经这样做了。

正在运行 Razor Engine 3.7.0

最佳答案

这似乎是 RazorEngine v 3.5 及更高版本的问题。 3.4.2 工作正常。

https://github.com/Antaris/RazorEngine/issues/284

关于c# - 找不到方法 : 'System. 字符串 RazorEngine.Templated.ITemplate.Run,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30420310/

相关文章:

c# - int + ""的性能命中而不是使用 int.ToString()

Azure key 保管库 - WebApp 在选择主体中不可见

azure - 我可以在本地服务器中部署的控制台应用程序中使用 Azure 托管标识吗?

ios - 将 Azure AD 访问控制集成到 iOS 应用程序的社交身份验证

ios - 从 SyncTable 拉取更新核心数据对象,而不是调用 NSFeatchedResults 委托(delegate)方法

c# - 无法从 List<DerivedClass> 转换为 List<BaseClass>

c# - Winforms Accordion

azure - 缺少 Azure 部署的 FileSystemPublish 目标

c# - 插入后获取结果ID

c# - 如何旋转游戏对象?