从Visual Studio 2010升级到2012后,代码开始抛出"ArgumentOutOfRangeException - 索引超出范围.必须是非负的且小于集合的大小.参数名称:索引"在使用联接的Linq查询上.
在LINQPad中使用以下简单示例(使用EF数据模型)给出了ArgumentOutOfRangeException:
void Main()
{
var iq1 = Customers.Select(ap => ap.ID);
var iq2 = iq1.Join(Customers.Select(ap => ap.ID),
a => a,
b => b,
(a, b) => new { a });
iq2.Dump();
}
Run Code Online (Sandbox Code Playgroud)
更改前面的示例以返回包含连接两边的匿名对象不会给出ArgumentOutOfRangeException并按预期方式给出结果:
void Main()
{
var iq1 = ActionPlans.Select(ap => ap.ID);
var iq2 = iq1.Join(ActionPlans.Select(ap => ap.ID),
a => a,
b => b,
(a, b) => new { a, b });
iq2.Dump();
}
Run Code Online (Sandbox Code Playgroud)
好的,所以由于某种原因我不得不返回连接的两边,但后来我尝试使用虚拟值代替以下示例,也执行没有问题:
void Main()
{
var iq1 = ActionPlans.Select(ap => ap.ID);
var iq2 …
Run Code Online (Sandbox Code Playgroud) 我正在Visual Studio Team Services中进行Azure应用服务部署(ASP.NET Core 2.0 Web Api),并希望替换appsettings.json中的一些值,因此我阅读了https://docs.microsoft.com/en-us/vsts/build-release/tasks/transforms-variable-substitution #jsonvarsubs,但他们谈论通过用句点(.)连接名称来替换文件的嵌套级别中的值.
问题是您无法在Azure Key Vault中使用句点(.).
有没有人知道如何使用Azure Key Vault中的秘密在appsettings.json文件中替换嵌套级别的变量?
azure azure-keyvault azure-devops asp.net-core azure-pipelines-release-pipeline
.net ×1
asp.net-core ×1
azure ×1
azure-devops ×1
azure-pipelines-release-pipeline ×1
exception ×1
linq ×1