我有两个关于功能的 .net 核心应用程序的问题。我正在使用 blobtrigger。
1) 当我在本地运行我的项目时,我在命令提示符控制台上得到了这个“托管环境”,我想了解这个变量集在哪里以及如何将其更改为开发。它具有误导性,因为我只在本地开发。
[5/23/2019 7:00:20 PM] 主机启动 (773ms) [5/23/2019 7:00:20 PM] 作业主机启动 托管环境:Production 内容根路径:C:Myproject\bin\Debug\ netcoreapp2.1现在监听:http://0.0.0.0:7071
2)host.json 和 local.settings.json 有什么区别。什么时候可以使用host.json?到目前为止,我只使用了 local.settings.json,当我发布到 azure 时,我正在创建 local.settings.json 中提到的配置,但没有使用 Host.json 看起来像。host.json 文件的目的是什么。
We have some .cs files in our project A that are needed in Project B.
First question: how do I share the files across projects without recreating them in the other project?
第二个问题:如果项目 A 是在 中制作的.Net,项目 B 是在 中制作的.NET Core,我们如何共享文件而不需要在两个项目中重新创建它们?
我正在使用 C#
我们必须编写多个触发器。我希望根据触发器类型创建单独的函数。因此,如果我需要 5 个将在不同时间运行的计时器触发器,我将创建一个计时器触发器函数类并将这些函数命名为[TimerTrigger1], [TimerTrigger2], [TimerTrigger3]... 等。添加代码后,我不确定是否可以再这样做。
有人可以建议我如何添加多个触发器吗?我不能Run在一个班级下有两个功能。
public static class TimerTrigger
{
[FunctionName("InsertTimerTrigger1")]
public static void Run([TimerTrigger("0 */5 * * * *")]TimerInfo myTimer, ILogger log)
{
// Do task 1
log.LogInformation($"C# Timer trigger function executed at: {DateTime.Now}");
}
[FunctionName("InsertTimerTrigger2")]
public static void Run([TimerTrigger("0 */15 * * * *")]TimerInfo myTimer, ILogger log)
{
//Do Task 2
log.LogInformation($"C# Timer trigger function executed at: {DateTime.Now}");
}
}
Run Code Online (Sandbox Code Playgroud) 我使用Visual Studio推送了.net核心功能应用程序,现在设置了发布管道。我可以很好地发布和执行该应用程序,它在Azure门户上运行良好。但是,当我在azure-devOps中看到发行版的版本时,该插槽将失败,并出现以下错误。
2019-06-19T23:21:33.3543380Z ##[error]Error: Deployment of msBuild generated package is not supported. Change package format or use Azure App Service Deploy task. D:\a\r1\a\_...AVFunctionCore.zip
Run Code Online (Sandbox Code Playgroud)
我不确定我需要在哪里检查安装程序甚至开始诊断问题。
这是管道步骤。我创建一个新阶段,然后选择一个类型的模板(Azure应用程序服务部署)
在任务“应用程序类型”下,是Windows上的“功能应用程序”。给应用程序名称,资源组,插槽和软件包文件夹指定为$(System.DefaultWorkingDirectory)/ ** / AVFunctionCore.zip
其他所有内容均保留为默认设置。
我需要一些帮助来清除用户从下拉列表中选择后的自动完成占位符,或者更好地显示标签的一部分而不是值。目前其显示价值。由于 Value 将成为唯一的 ID,因此我们不希望最终用户看到它。这是我正在关注的示例的 URL https://ant.design/components/auto-complete/
这是我的代码
import React, { useState } from "react";
import { Input, AutoComplete } from "antd";
import { SelectProps } from "antd/es/select";
const SearchBar: React.FC<> = () => {
const [options, setOptions] = useState<SelectProps<unknown>["options"]>([]);
const handleSearch = async (value: string) => {
setOptions(
value ? await searchResults() : []
);
};
const onSelect = (value: string) => {
console.log (value)
};
return (
<AutoComplete
dropdownMatchSelectWidth={300}
style={{ width: 350 }}
options={options}
onSelect={onSelect}
onSearch={handleSearch}
>
<Input.Search
size="large" …Run Code Online (Sandbox Code Playgroud) 我在SQL中执行except和union语句时看到一种奇怪的行为。
我有两张桌子
Select * from #old
Run Code Online (Sandbox Code Playgroud)
数据看起来像这样
oid1 oid2 co
1 11 1
2 22 1
3 33 1
4 55 1
Select * from #new
nid1 nid2 co
1 11 3
2 22 1
3 33 1
4 44 1
4 55 1
Run Code Online (Sandbox Code Playgroud)
这是我最后的查询
Select * from #old
except
Select * from #new
union all
Select * from #new
except
Select * from #old
Run Code Online (Sandbox Code Playgroud)
并提供这些记录
oid1 oid2 co
1 11 3
4 44 1
Run Code Online (Sandbox Code Playgroud)
我的问题是..不应该在第一个except子句的另一行中:
Select * from #old …Run Code Online (Sandbox Code Playgroud) 我在LINQ方面的经验非常有限,想了解这段代码如何获取价值。它是在整个列表中进行搜索还是在列表中命中确切的记录,这是因为alternateId = Names.ElementAt(n).它在SQL中对我来说看起来像是“ Where子句”。但这可能有所不同。
只是试图了解完整列表搜索的成本(如果发生了这种情况)
MapList.Find(x => x.AlternateId == Names.ElementAt(n).ToString()).MyColumValue;
Run Code Online (Sandbox Code Playgroud) azure ×3
c# ×2
.net ×1
.net-core ×1
antd ×1
asp.net-core ×1
azure-devops ×1
azureportal ×1
linq ×1
reactjs ×1
sql ×1
sql-except ×1
typescript ×1
union ×1