小编thu*_*nch的帖子

在 AWS 上部署 blazor 服务器应用程序“错误:如果连接不处于“已连接”状态,则无法发送数据。” 但可以在本地主机上运行

我有一个 blazor 服务器应用程序,它是使用 AWS Beanstalk 部署在 AWS 上的 .Net 5.0 应用程序。它是单实例部署,因此我目前无法使用负载平衡(由于当前给我的限制)。部署的环境平台是“在64位Windows Server Core 2019/2.6.3上运行的IIS 10.0”。当我在 VS2019 和本地 iis 服务器上本地运行此应用程序时,该应用程序运行良好。但是一旦部署,它就会在浏览器控制台中抛出错误:

blazor.server.js:1 [2021-02-19T17:17:03.896Z] Error: Failed to start the transport 'LongPolling': Error
e.log @ blazor.server.js:1
blazor.server.js:1 [2021-02-19T17:17:03.897Z] Error: Failed to start the connection: Error: Unable to connect to the server with any of the available transports. ServerSentEvents failed: Error: 'ServerSentEvents' does not support Binary. LongPolling failed: Error
e.log @ blazor.server.js:1
blazor.server.js:19 [2021-02-19T17:17:03.897Z] Error: Error: Unable to connect to the server with any of …
Run Code Online (Sandbox Code Playgroud)

c# amazon-web-services amazon-elastic-beanstalk .net-core blazor

4
推荐指数
1
解决办法
4448
查看次数

.net postgres EF core 无法将 Kind=Local 的 DateTime 写入 PostgreSQL 类型“带时区的时间戳”

我有一个使用 nuget 包的 .Net6 控制台应用程序:

  • “Microsoft.EntityFrameworkCore,版本 6.0.8”
  • “Npgsql.EntityFrameworkCore.PostgreSQL,版本 6.0.6”
  • “Npgsql,版本 6.0.6”

我使用 postgres 14.4 作为安装并用于运行脚本等。
我运行一个名为“createTables.sql”的 .sql 脚本,如下所示

create table if not exists "Messages" (
    "Id" uuid primary key,
    "Time" timestamp without time zone,
    "MessageType" text,
    "Message" text
);
Run Code Online (Sandbox Code Playgroud)

我的 EF 核心上下文如下所示

namespace Database;

public class MessageContext : DbContext
{
  protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
  {
    var dbConfig = Configurer.Config.MessageDbConfig;
    optionsBuilder.UseNpgsql(new NpgsqlConnectionStringBuilder
      {
        Database = dbConfig.DbName,
        Username = dbConfig.Username,
        Password = dbConfig.Password,
        Host = dbConfig.Host,
        Port = dbConfig.Port,
        Pooling = …
Run Code Online (Sandbox Code Playgroud)

c# postgresql datetime entity-framework-core

4
推荐指数
1
解决办法
1万
查看次数