我想创建一个Android应用程序,可以在使用2.3.3一路走过来4.0.3.我想使用支持库,以便我可以使用片段等.
我是否将构建目标设置为API 级别10(2.3.3)或将其设置为15(4.0.3)?
我正在从简单的Ninject世界转移到Simple Injector的快速世界,但我已经陷入了SolrNet的困境.许多流行的IoC已经有SolrNet集成,但不是SimpleInjector.
我已经开始通过转换https://github.com/mausch/SolrNet/tree/master/Unity.SolrNetIntegration中发现的Unity内容来创建自己的集成.
有没有人知道这是否已经完成(由比我更了解的人)或任何人都可以转换下面使用简单的注射器:
private static void RegisterSolrOperations(SolrCore core, IUnityContainer container, bool isNamed = true) {
var ISolrReadOnlyOperations = typeof (ISolrReadOnlyOperations<>).MakeGenericType(core.DocumentType);
var ISolrBasicOperations = typeof (ISolrBasicOperations<>).MakeGenericType(core.DocumentType);
var ISolrOperations = typeof (ISolrOperations<>).MakeGenericType(core.DocumentType);
var SolrServer = typeof (SolrServer<>).MakeGenericType(core.DocumentType);
var registrationId = isNamed ? core.Id : null;
var injectionConstructor = new InjectionConstructor(
new ResolvedParameter(ISolrBasicOperations, registrationId),
new ResolvedParameter(typeof (IReadOnlyMappingManager)),
new ResolvedParameter(typeof (IMappingValidator)));
container.RegisterType(ISolrOperations, SolrServer, registrationId, injectionConstructor);
container.RegisterType(ISolrReadOnlyOperations, SolrServer, registrationId, injectionConstructor);
}
Run Code Online (Sandbox Code Playgroud)
到目前为止,我有:
private static void RegisterSolrOperations(SolrCore core, Container container, bool isNamed = …Run Code Online (Sandbox Code Playgroud) 我正在尝试创建一个具有虚拟机的 ARM 模板,我希望虚拟机能够将AcrPull角色分配给位于不同资源组中的容器注册表。我将范围属性设置为 ACR 的 ID(我从https://resources.azure.com获得)。
{
"apiVersion": "2017-09-01",
"type": "Microsoft.Authorization/roleAssignments",
"name": "[guid(resourceGroup().id, 'stuff')]",
"properties": {
"roleDefinitionId": "[variables(parameters('builtInRoleType'))]",
"principalId": "[reference(variables('vmResourceId'), '2017-12-01', 'Full').identity.principalId]",
"scope": "[concat(/subscriptions/abc123-x123-4bef-84ec-1716390f231b/resourceGroups/someresroucegroupname/providers/Microsoft.ContainerRegistry/registries/someacrname"
},
"dependsOn": [
"[concat('Microsoft.Compute/virtualMachines/', variables('vmName'))]"
]
}
Run Code Online (Sandbox Code Playgroud)
我不断收到错误:
"The request to create role assignment '694829aa-cee5-4fe3-bf94-3ae372c14f26' is not valid. Role
assignment scope '/subscriptions/abc123-x123-4bef-84ec-1716390f231b' must match the scope specified on
the URI '/subscriptions/abc123-x123-4bef-84ec-1716390f231b/resourcegroups/myresourcegroupname'.
Run Code Online (Sandbox Code Playgroud)
这可能吗?