我想创建一个连续运行的webjob但首先我想尝试在本地运行它以进行调试.我正在使用Visual Studio 2015,我运行了azure存储模拟器(我可以在visual studio中运行azure webjobs的示例).当我运行它时,它在新的JobHost()行上失败.
例外:值不能为空.参数名称:方法
static void Main()
{
var host = new JobHost();
host.CallAsync(typeof(Functions).GetMethod("GetNextJob"));
// The following code ensures that the WebJob will be running continuously
host.RunAndBlock();
}
[NoAutomaticTriggerAttribute]
public static async Task GetNextJob()
{
while(true)
{
try
{
var log = new Logger();
log.WriteInfo("Getting next job to be run", 0, 0, "Brain");
//Console.WriteLine("Getting new Job and putting to que");
}
catch(Exception ex)
{
Console.WriteLine(ex.Message);
}
await Task.Delay(TimeSpan.FromSeconds(5));
}
}
Run Code Online (Sandbox Code Playgroud)
我可以在本地运行连续运行的工作吗?
我的原始json字符串通过AJAX post传递给MVC ActionResult控制器
{"ID":0,"RoutingRuleID":24,"ConditionalType":0,"Field":"Channel","ConditionalOperator":"5","Values":[1,9],"ValueString":""}
Run Code Online (Sandbox Code Playgroud)
但最终发生的事情是,一旦json对象进入MVC控制器,它就会丢失关联数组"值"中的值.其他属性设置正确.
我在C#中的模型类如下:
public class RoutingConditional
{
public int ID { get; set; }
public int ParentID { get; set; }
public string ConditionalType { get; set; }
public string Field { get; set; }
public string ConditionalOperator { get; set; }
public List<string> Values { get; set; }
public string ValueString{get;set;}
public RoutingConditional()
{
//this.Values = new List<string>(); //I tried to initialize it too did not work
}
}
Run Code Online (Sandbox Code Playgroud)
我的MVC控制器
[HttpPost]
public ActionResult EditConditional(RoutingConditional rcview)
{ …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用GitHub中的Knockoutjs Validation添加.大多数似乎工作得很好,但当我尝试使用扩展验证mustEqual(密码/确认密码)时,它似乎没有做任何事情.我错过了什么?
我非常想学习这种扩展技术以备将来使用.
(这也是整个html和javascript通过AJAX调用加载到页面.如果与它有任何关系.)
我的javascript
function UserAccount(data) {
var self = this;
self.Password = ko.observable(data.Password).extend({ required: true, minlength: 6, message: "Password is required", maxLength: 12 });
self.Firstname = ko.observable(data.Firstname).extend({ required: true, minlength: 6, message: "Firstname is required", maxLength: 40 });
self.Lastname = ko.observable(data.Lastname).extend({ required: true, minlength: 6, message: "Lastname is required", maxLength: 40 });
self.Email = ko.observable(data.Email).extend({ required: true, minlength: 6, message: "Email is required", email: true, maxLength: 90 });
self.ConfirmPassword = ko.observable().extend({ mustEqual: self.Password()});
...........................Other Code............
}
ko.validation.rules['mustEqual'] = …Run Code Online (Sandbox Code Playgroud) 我正在尝试将SSL证书加载到我的Azure环境中.我按照此处的官方Azure文档说明进行操作.
当我运行certreq -accept -user ...它返回:
无法安装证书颁发机构颁发的证书.联系您的管理员.找不到对象或属性.0x80092004(-2146885628 CRYPT_E_NOT_FOUND)
我是以管理员身份运行的.我正在使用GoDaddy获取我的证书.我转换了godaddy给你的crt(出口).
我没有看到任何修复,但标准"支付我们,我们将为您修复间谍软件"
采取的步骤:
我在go daddy上创建了dns子域名.
然后,我按照上面链接中的说明创建了我的证书请求.(创建文本文件并对其运行certreq -new命令.
我把这个文件上传到godaddy
当godaddy完成授权我的密钥后,我下载了密钥的IIS版本.
解压缩内容.两个文件包括crt和p7b
我在个人文件夹中将证书安装在我的本地计算机上(我尝试使用和不使用此步骤).
然后我将crt导出到cer文件.我注意到它确实说它没有在导出的最后一个屏幕上导出密钥.
然后我在cer上运行了certreq -accept -user命令.此时我收到了Crypt_E_Not_found错误.
我有两个班GenericNameValue,并SpecificNameValue与继承GenericNameValue.
我有一个带参数的函数List<GenericNameValue>.我希望能够传入List<SpecificNameValue>.该函数对该函数的特殊属性不起作用SpecificNameValue.
这样做的最佳方法是什么?
public class GenericNameValue
{
public string FieldName{get;set;}
public string FieldValue{get;set;}
}
public class SpecificNameValue : GenericNameValue
{
public string SpecificFieldValue{ get; set; }
}
public static UtitlityClass
{
public string CombineAllFields(List<GenericNameValue> mylist)
{
//.... do stuff with each item
}
}
//......Example of calling the utilityclass
string stuff = UtilityClass.CombineAllFields(mySpecificNameValue);
Run Code Online (Sandbox Code Playgroud)
那么我缺少一个特定的语法吗?我应该使用像Abstracts这样的东西吗?
对不起,这只是导致我头疼一段时间的事情之一,并希望一个优雅的解决方案.