发布到Azure后无法将函数参数绑定到TraceWriter类型
我遵循指南:发布到Azure后无法将函数参数绑定到TraceWriter类型,azure,f#,azure-functions,Azure,F#,Azure Functions,我遵循指南: 创建的dotnet f#项目:dotnet新类库--语言f#--名称HelloFunctions 添加了对函数的引用:dotnet添加包Microsoft.NET.Sdk.functions 添加了如下文件Library.fs中所述的新函数,添加了配置文件等 编译函数 它通过dotnet build&&dotnet publish&&cd bin/Debug/netstandard2.0/publish&&func start在本地成功启动 将其发布到Azure:func Azur
dotnet新类库--语言f#--名称HelloFunctions
dotnet添加包Microsoft.NET.Sdk.functions
dotnet build&&dotnet publish&&cd bin/Debug/netstandard2.0/publish&&func start在本地成功启动
func Azure functionapp Publish
Function ($Hello) Error: Microsoft.Azure.WebJobs.Host:
Error indexing method 'Functions.Hello'. Microsoft.Azure.WebJobs.Host:
Cannot bind parameter 'log' to type TraceWriter. Make sure the parameter Type
is supported by the binding. If you're using binding extensions (e.g.
ServiceBus, Timers, etc.) make sure you've called the
registration method for the extension(s) in your startup code (e.g.
config.UseServiceBus(), config.UseTimers(), etc.).
namespace HelloFunctions
open System
open Microsoft.Azure.WebJobs
open Microsoft.Azure.WebJobs.Host
module Say =
let private daysUntil (d: DateTime) =
(d - DateTime.Now).TotalDays |> int
let hello (timer: TimerInfo, log: TraceWriter) =
let christmas = new DateTime(2017, 12, 25)
daysUntil christmas
|> sprintf "%d days until Christmas"
|> log.Info
听起来很像程序集版本冲突(运行时运行Microsoft.Azure.WebJobs.Host.dll的一个版本,而您的应用程序引用了另一个版本)
我的猜测是,您使用运行时版本2.0编译了本地应用程序,而Azure Function应用程序配置为1.0(默认)。请检查。听起来很像程序集版本冲突(运行时运行Microsoft.Azure.WebJobs.Host.dll的一个版本,而您的应用程序引用了另一个版本)
我的猜测是,您使用运行时版本2.0编译了本地应用程序,而Azure Function应用程序配置为1.0(默认)。请检查。不兼容的库版本:程序集是根据与函数框架使用的.NET版本不同的.NET版本编译的。不兼容的库版本:程序集是根据与函数框架使用的.NET版本不同的.NET版本编译的。