问题描述
最近,我使用 *.csx) 的 Azure 函数转换为预编译的类库.com/webdev/2017/05/10/azure-function-tools-for-visual-studio-2017/" rel="nofollow noreferrer">适用于 Azure Functions 的 Visual Studio Studio 工具.它在 Visual Studio 2017 中成功构建(以及运行和调试).
Recently, I converted an Azure Function that used a C# script (*.csx) to a pre-complied class library using the Visual Studio Studio Tools for Azure Functions. It builds successfully in Visual Studio 2017 (as well as running and debugging too).
我想通过我们的 CI 流程构建这个 AF 库.但是,当我在本地运行命令 dotnet build 时,它会失败并出现以下错误:
I'd like to build this AF library via our CI process. However, when I run the command dotnet build locally it fails with the following error:
C:Users ay.nugetpackagesmicrosoft.net.sdk.functions1.0.2uild etstandard1.0Microsoft.NET.Sdk.Functions.Build.targets(31,5):错误:无法加载文件或程序集Microsoft.Azure.WebJobs.Host,版本=2.1.0.0,文化=中性,PublicKeyToken=31bf3856ad364e35".该系统找不到指定的文件.
C:Users ay.nugetpackagesmicrosoft.net.sdk.functions1.0.2uild etstandard1.0Microsoft.NET.Sdk.Functions.Build.targets(31,5): error : Could not load file or assembly 'Microsoft.Azure.WebJobs.Host, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
同样的错误也发生在我们的 CI 构建中.
The same error also occurs in our CI build.
不确定为什么会发生此错误以及如何解决它.它是 dotnet CLI 的版本(我使用的是 v1.1)吗?是别的吗?
Not sure why this error is occurring and how to resolve it. Is it the version of the dotnet CLI (I'm using v1.1)? Is it something else?
推荐答案
UPDATE 2018-01-08
根据@theGRS https://stackoverflow.com/a/48156446/621827 的新回答,这有已解决.
According to a new answer by @theGRS https://stackoverflow.com/a/48156446/621827 this has been resolved.
上一个答案
这是我找到的.
dotnet msbuild 使用 Microsoft.NET.Sdk.Functions .NETStandard 1.5 库,如果您查看 NuGet 它不使用 Microsoft.Azure.WebJobs
dotnet msbuild uses the Microsoft.NET.Sdk.Functions .NETStandard 1.5 library which if you look at the dependencies on NuGet it doesn't use Microsoft.Azure.WebJobs
但如果您使用 Visual Studio 2017 msbuild,它将使用库的 .NETFramework 4.6 版本,其中包括 Microsoft.Azure.WebJobs.
But if you use the Visual Studio 2017 msbuild it will use the .NETFramework 4.6 version of the library which includes Microsoft.Azure.WebJobs.
我的建议是现在使用 MSBuild.
My suggestion is to use MSBuild for now.
这篇关于使用预编译的 Azure 函数库生成错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)