Azure函数未建立,错误不断抛出 [英] Azure function not building, errors keep throwing up

查看:102
本文介绍了Azure函数未建立,错误不断抛出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我遇到了几个小时都无法理解的问题.
我刚刚创建了一个Azure函数应用程序(几天前我的Visual Studio等都更新到了最新版本).几个月前,我已经能够构建azure函数,但是现在不能.它抛出以下错误

Hi, I am stuck with an issue I can't understand for hours. 
I just created a Azure function app (my visual studio, etc are all updated to latest version couple of days back). I was able to build azure functions few months back, but can't do now. It throws below error

错误信息的文本如下

Text of error message is as below

严重性 代码 说明 项目 文件 Line 抑制状态
错误 System.IO.FileLoadException:无法加载文件或程序集'file:///C:\ synched \ OneDrive \ synchedFinal \ development \ scraperUpworkCodementor \ FnScrap \ FnScrap \ bin \ Debug \ net461 \ bin \ FnScrap.dll"或其依赖项之一. 不支持该操作. (来自HRESULT的异常:0x80131515)

System.IO.FileLoadException:无法加载文件或程序集或其依赖项之一.不支持该操作. (来自HRESULT的异常:0x80131515)

文件名:'file:///C:\ synched \ OneDrive \ synchedFinal \ development \ scraperUpworkCodementor \ FnScrap \ FnScrap \ bin \ Debug \ net461 \ bin \ FnScrap.dll'---> System.NotSupportedException:试图从网络位置加载程序集 使程序集在.NET Framework的早期版本中被沙箱化.默认情况下,此版本的.NET Framework不启用CAS策略,因此此加载可能很危险.如果此负载不是要对组件进行沙箱处理,请启用 loadFromRemoteSources开关.有关更多信息,请参见http://go.microsoft.com/fwlink/?LinkId=155569.
    at System.Reflection.RuntimeAssembly._nLoad(AssemblyName文件名,字符串codeBase,证据程序集安全性,RuntimeAssembly locationHint,StackCrawlMark& stackMark,IntPtr pPrivHostBinder,布尔throwOnFileNotFound,布尔forIntrospection, 布尔值preventSecurityChecks)
 在System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName程序集Ref,证据程序集安全性,RuntimeAssembly reqAssembly,StackCrawlMark& stackMark,IntPtr pPrivHostBinder,布尔throwOnFileNotFound,布尔值用于自省, 布尔值preventSecurityChecks)
 在System.Reflection.RuntimeAssembly.InternalLoadFrom(String     at System.Reflection.Assembly.LoadFrom(String assemblyFile)
    at MakeFunctionJson.FunctionJsonConverter.TryGenerateFunctionJsons()
    at MakeFunctionJson.FunctionJsonConverter.TryRun()


生成函数元数据时出错
FnScrap C:\ Users \ Sujit \ .nuget \ packages \ microsoft.net.sdk.functions \ 1.0.13 \ build \ netstandard1.0 \ Microsoft.NET.Sdk.Functions.Build.targets

Severity Code Description Project File Line Suppression State
Error System.IO.FileLoadException: Could not load file or assembly 'file:///C:\synched\OneDrive\synchedFinal\development\scraperUpworkCodementor\FnScrap\FnScrap\bin\Debug\net461\bin\FnScrap.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)

System.IO.FileLoadException: Could not load file or assembly or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)

File name: 'file:///C:\synched\OneDrive\synchedFinal\development\scraperUpworkCodementor\FnScrap\FnScrap\bin\Debug\net461\bin\FnScrap.dll' ---> System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.
   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
   at System.Reflection.Assembly.LoadFrom(String assemblyFile)
   at MakeFunctionJson.FunctionJsonConverter.TryGenerateFunctionJsons()
   at MakeFunctionJson.FunctionJsonConverter.TryRun()


Error generating functions metadata
FnScrap C:\Users\Sujit\.nuget\packages\microsoft.net.sdk.functions\1.0.13\build\netstandard1.0\Microsoft.NET.Sdk.Functions.Build.targets 39

======================

=======================

我尝试过更改框架,清理框架,但所有错误都不会消失.

I tried changing frameworks, cleaning it and all but this error doesn't go away.

谢谢

sujit

推荐答案

您是否遵循任何特定文档来创建此应用?否则,您是否只是在VS中选择一个简单的Function并进行构建?我也可以为您尝试复制.通常,您看到的错误与某些依赖性未正确加载有关 或正在安装. 
Are you following any specific documentation to create this app? Else are you just selecting a simple Function in VS and building it? I can attempt a repro for you as well. Generally the error you are seeing has to do with some dependency not loading properly or being installed. 


这篇关于Azure函数未建立,错误不断抛出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆