我在网站上嵌入视频有点新鲜.最好的方法是什么?我刚刚开始阅读它.
我读到我应该使用HTML5和浏览器的原生播放器. - 有没有人知道一个javascript库,它将使用浏览器的播放器并检测浏览器是否没有使用HTML5降级到Flash播放器?
至于编码什么是最好的方法?我打算编写一个小控制台应用程序来使用FFMPEG转换视频.但是我应该使用什么编码?我听说H.264很有前途吗?但
我开始使用ELMAH,我觉得它很棒.我在线阅读了一些文档,但现在我的应用程序没有角色/用户授权设置.
我希望能够通过访问/elmah.axd来阅读生产中的错误日志,但我不想只向所有人开放,elmah是否有任何允许我创建密码的功能(在网络中).配置)并通过查询字符串传递它?模仿"安全"RSS源.或类似的事情....
我正在使用Microsoft.ApplicationInsights.AspNetCore(https://www.nuget.org/packages/Microsoft.ApplicationInsights.AspNetCore)。
我通过在Programs.cs和启动类中添加.UseApplicationInsights()来启用应用程序见解:
loggerFactory.AddApplicationInsights(app.ApplicationServices);
Run Code Online (Sandbox Code Playgroud)
一切正常,我可以在应用程序洞察中查看请求,但是当我尝试记录错误时(例如在控制器中):
_logger.LogError("My Error Log");
_logger.LogError("Test", new Exception("Test"));
Run Code Online (Sandbox Code Playgroud)
两者均记录为跟踪事件,而不是应用程序见解中的异常。
我如何使它记录为例外?
我有 2 个 .net core 应用程序在 docker 中运行(一个是 Web api,另一个是使用 Web api 的 Web 应用程序):
我似乎无法通过 Web 应用程序与 api 进行通信,但我可以通过在浏览器中直接访问 api http://localhost:44389来访问它
我的网络应用程序中有一个环境变量具有相同的信息,但它无法访问它。
如果我要在 azure 上指定 API 的部署版本,它就能够与该地址进行通信。问题似乎出在容器之间的相互通信上。
我读到创建一座桥梁应该可以解决这个问题,但似乎并没有。我究竟做错了什么?
这是我的 docker 撰写文件:
version: '3.4'
services:
rc.api:
image: ${DOCKER_REGISTRY}rcapi
build:
context: .
dockerfile: rc.Api/Dockerfile
ports:
- "44389:80"
rc.web:
image: ${DOCKER_REGISTRY}rcweb
build:
context: .
dockerfile: rc.Web/Dockerfile
environment:
- api_endpoint=http://localhost:44389
depends_on:
- rc.api
networks:
my-net:
driver: bridge
Run Code Online (Sandbox Code Playgroud) 我在下面有以下类,我想返回特定状态的所有USLocation类:
var usLocations = (from s in GetUSStates() where s.Code == stateCode select s.Locations);
Run Code Online (Sandbox Code Playgroud)
但我一直收到错误:
无法将类型'System.Collections.Generic.IEnumerable <System.Collections.Generic.IEnumerable <A.Model.USLocation >>'隐式转换为'System.Collections.Generic.List <A.Model.USLocation>'.存在显式转换(您是否错过了演员?)
看起来像"选择s.Locations正在回收集合中的集合.我在这里做错了什么?
public class USState
{
public int Id { get; set; }
public string Name { get; set; }
public string Code { get; set; }
public IEnumerable<USLocation> Locations { get; set; }
public override string ToString()
{
return string.Format("{0}:{1} ({2})", Name, Code, Id);
}
}
public class USLocation
{
public int Id { get; set; }
public string Name …Run Code Online (Sandbox Code Playgroud) c# ×2
.net-core ×1
asp.net-core ×1
asp.net-mvc ×1
docker ×1
elmah ×1
html5-video ×1
javascript ×1
linq ×1