An unexpected error occurred: System.NullReferenceException: Object reference not set to an instance of an object. at LibGit2Sharp.Core.Handles.ObjectHandle.op_Implicit(ObjectHandle handle) in /_/LibGit2Sharp/Core/Handles/Objects.cs:line 509 at LibGit2Sharp.Core.Proxy.git_commit_author(ObjectHandle obj) in /_/LibGit2Sharp/Core/Proxy.cs:line 289 at
在没有在 yaml 中进行设置的选项的azure devops yaml 管道上运行任务 gitversion/execute 时出现错误
##[debug]fetchDepth=1
,因为这已更改为 Microsoft 的默认值。
有没有办法git gc --prune=now在远程Team Foundation Server 2015(tfs2015)上运行?或者是git gc --prune=now本地运行然后在tfs2015上创建新存储库并将其推送到新远程存储库,然后删除旧存储库,并将新存储库重命名为旧名称的唯一方法.这样做时不要忘记关闭喜欢的提交.
我想创建一个Azure函数(C#API通用HTTP)方法,将文件上载到Office365 Sharepoint文档库.
由于OneDrive API允许我上传大文件(使用守护程序进程和证书身份验证),因此我成功地使用C#控制台应用程序实现了目标.
现在的想法是将代码移动到Azure功能中.但是,在加载pfx证书时,我在函数运行期间收到错误.
public static async Task<bool> Run(HttpRequestMessage req, TraceWriter log)
{
string certfile = System.IO.Path.Combine(Environment.ExpandEnvironmentVariable??s("%HOME%"), @"site\wwwroot\<functionname>\mykeyfile.pfx");
X509Certificate2 cert = new X509Certificate2(certfile, "<myinsanepwd>");
return true; //temporary
}
Run Code Online (Sandbox Code Playgroud)
行X509Certificate2 cert = new X509Certificate2(certfile,""); 抛出异常System.Security.Cryptography.CryptographicException:系统找不到指定的文件.
这真的很奇怪,因为文件存在于指定的路径上(我在方法中使用File.Exists()检查:))这个错误可能与support.microsoft.com/en-us/kb/948154有关吗?我怎么解决这个问题?
此致,Jens
Azure 文件存储活动可以触发 Azure WebJob 或 Azure Function 吗?
例如,在文件夹“/todo/”中创建文件时。
我希望有人可以帮助我.我正在实现一个Azure功能,我试图将XML消息序列化为.Net对象.这是我目前使用的代码:
public static void Run(string input, TraceWriter log)
{
System.Xml.Serialization.XmlSerializer serializer = new System.Xml.Serialization.XmlSerializer(typeof(App));
// more code here....
}
public class App
{
public string DataB { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
但是,我总是遇到这个错误:
2017-01-17T12:21:35.173 Exception while executing function: Functions.ManualXmlToJson. mscorlib: Exception has been thrown by the target of an invocation. System.Xml: Identifier 'Submission#0' is not CLS-compliant.
Run Code Online (Sandbox Code Playgroud)
参数名称:ident.
我尝试过没有它们的XmlAttributes.我在文件中添加了buildOptions:warningsAsErrorsas 但没有任何反应.说实话,我没有想法,因为这段代码实际上是在App Console中运行的.falseproject.json
我想是某些参数,我真的很感激,如果有人可以建议我如何解决它.
谢谢!
我有一个TimerTrigger函数,并且输出绑定是Azure队列。
这个想法是,计时器每10分钟运行一次,它将查看数据库中的一个视图,并迭代返回的所有行,并将它们作为消息添加到队列中。
以下是我的示例TimerTrigger。将消息添加到队列中效果很好。
但是,在我的实际情况中,有些行将需要立即执行,而另一些行则将延迟几分钟(每行变化)。我计划通过使用VisibilityTimeout处理消息来处理延迟。
不幸的是,通过字符串进行绑定无法让我设置值。CloudQueueMessage.VisiblityTimeout(以下使用)是只读的。
#r "Microsoft.WindowsAzure.Storage"
using System;
using Microsoft.WindowsAzure.Storage.Queue;
public static void Run(TimerInfo myTimer, ICollector<CloudQueueMessage> outputQueueItem, TraceWriter log)
{
log.Info($"C# Timer trigger function executed at: {DateTime.Now}");
//- Add a message to be processed now.
CloudQueueMessage msg = new CloudQueueMessage("Now");
outputQueueItem.Add(msg);
//- Add a message to be processed later.
//- this code below won't work because NextVisibleTime is readonly.
//- is there some way to set the VisibilityTimeout property before queueing?
msg = new CloudQueueMessage("Later");
DateTime otherDate = DateTime.Now.AddMinutes(3); …Run Code Online (Sandbox Code Playgroud) 需要帮助找到一种方法来部署我的应用程序的自定义应用程序设置 - 1.使用我的.funproj创建的appsettings.json(vs 2015年的工具)2.appveyor的环境变量3.任何其他技巧
我想要的是避免在门户中手动设置这些东西并让它们受源控制(更好 - 使用部署,例如 - appveyor的安全环境变量)
提前致谢!以下是我目标的门户网站设置示例 -
appveyor的环境变量设置示例 -
environment:
SolutionDir: $(APPVEYOR_BUILD_FOLDER)\
my_var1: value1
my_var2: value2
Run Code Online (Sandbox Code Playgroud)
函数应用程序中的示例用法(run.csx) -
using System;
using System.Runtime.InteropServices;
using System.Runtime.Remoting.Messaging;
public static void Run(string input, TraceWriter log)
{
log.Info($"C# manually triggered function called with input: {input}");
log.Info($"This is a custom setting: {GetEnvironmentVariable("my_var1")}");
}
public static string GetEnvironmentVariable(string name)
{
return name + ": " +
System.Environment.GetEnvironmentVariable(name, EnvironmentVariableTarget.Process);
}
Run Code Online (Sandbox Code Playgroud) 为什么不#load工作
我已经在相同的文件夹和相关文件夹中尝试了它,如下所示
我错过了什么?
run.fsx是
#load "../shared/shared.fsx"
let key = "MyKey"
let Run(message: string, log: TraceWriter, result: byref<string>) =
result <- doItAll message key
log.Info(sprintf "F# results: %s" result)
Run Code Online (Sandbox Code Playgroud)
shared.fsx是
let doItAll message key = key + " has handled " + message
Run Code Online (Sandbox Code Playgroud)
错误是
run.fsx(x,y): error FS39: The value or constructor 'doItAll' is not defined
Run Code Online (Sandbox Code Playgroud) 我正在使用 Azure 函数并制定消费计划,我在 %temp% 目录中有一些我需要的文件。它允许的最大文件夹大小是多少?
如果这意味着什么,我的文件大约是 2GB。我需要它们,因为我必须对它们执行一些操作。
是否可以将您的天蓝色功能分组到子文件夹中。似乎您的function.json的位置需要
/{functionName}/function.json
Run Code Online (Sandbox Code Playgroud)
我想要这样的东西
/{category}/{functionName}/function.json
Run Code Online (Sandbox Code Playgroud)
当我尝试此但未检测到功能时
azure ×8
azure-devops ×2
appveyor ×1
azure-files ×1
c# ×1
f# ×1
git ×1
gitversion ×1
tfs ×1
tfs-2015 ×1
visibility ×1