嗖嗖社区 嗖嗖社区
首页
  • 开发日志
  • 使用指南
  • 模型概述
  • 模型平台

    • 平台开发
    • 平台展示
    • 标准化接口
  • MIKE模型

    • 模型简介
    • 使用技巧
    • 开发技巧
  • EFDC模型

    • 模型简介
    • 使用技巧
    • 开发技巧
  • Delft3D模型

    • 模型简介
    • 使用技巧
    • 开发技巧
  • HEC模型

    • 模型简介
    • 使用技巧
    • 开发技巧
  • WASH123D模型

    • 模型简介
    • 使用技巧
    • 开发技巧
  • SWMM模型

    • 模型简介
    • 使用技巧
    • 开发技巧
  • HSPF模型

    • 模型简介
    • 使用技巧
    • 开发技巧
  • 水文模型
  • 机器学习

    • 模型简介
    • 使用技巧
    • 开发技巧
  • 模型比较
  • 坐标系统
  • Arcgis

    • 软件简介
    • 使用技巧
    • 开发技巧
  • QGIS

    • 软件简介
    • 使用技巧
    • 开发技巧
  • 项目库

    • 政府采购环保项目
    • 政府采购水利项目
  • 模拟数据

    • 开放数据
  • 环境信息

    • 污染源
  • 标准化报告

    • 标准化分析报告
  • 闲聊
  • 语言

    • .net
    • python
    • 混合编程
  • 数据库及分布式存储
  • Web、服务器安全
  • 工具

    • git
    • vs
  • 开发问题集锦
  • 系统

    • Windows
    • Linux
  • 问题与挑战
  • 鄱阳湖流域

    • 模型研究
    • 信息管理平台
  • 太湖流域

    • 模型研究
    • 信息管理平台
  • 巢湖流域

    • 模型研究
    • 信息管理平台
  • 渤海湾

    • 模型研究
    • 信息管理平台
  • 环境观察
  • 环评
  • 排污许可
  • 防洪、内涝
  • 水环境治理
  • 那些年那些事
关于
  • 分类
  • 标签
  • 归档
首页
  • 开发日志
  • 使用指南
  • 模型概述
  • 模型平台

    • 平台开发
    • 平台展示
    • 标准化接口
  • MIKE模型

    • 模型简介
    • 使用技巧
    • 开发技巧
  • EFDC模型

    • 模型简介
    • 使用技巧
    • 开发技巧
  • Delft3D模型

    • 模型简介
    • 使用技巧
    • 开发技巧
  • HEC模型

    • 模型简介
    • 使用技巧
    • 开发技巧
  • WASH123D模型

    • 模型简介
    • 使用技巧
    • 开发技巧
  • SWMM模型

    • 模型简介
    • 使用技巧
    • 开发技巧
  • HSPF模型

    • 模型简介
    • 使用技巧
    • 开发技巧
  • 水文模型
  • 机器学习

    • 模型简介
    • 使用技巧
    • 开发技巧
  • 模型比较
  • 坐标系统
  • Arcgis

    • 软件简介
    • 使用技巧
    • 开发技巧
  • QGIS

    • 软件简介
    • 使用技巧
    • 开发技巧
  • 项目库

    • 政府采购环保项目
    • 政府采购水利项目
  • 模拟数据

    • 开放数据
  • 环境信息

    • 污染源
  • 标准化报告

    • 标准化分析报告
  • 闲聊
  • 语言

    • .net
    • python
    • 混合编程
  • 数据库及分布式存储
  • Web、服务器安全
  • 工具

    • git
    • vs
  • 开发问题集锦
  • 系统

    • Windows
    • Linux
  • 问题与挑战
  • 鄱阳湖流域

    • 模型研究
    • 信息管理平台
  • 太湖流域

    • 模型研究
    • 信息管理平台
  • 巢湖流域

    • 模型研究
    • 信息管理平台
  • 渤海湾

    • 模型研究
    • 信息管理平台
  • 环境观察
  • 环评
  • 排污许可
  • 防洪、内涝
  • 水环境治理
  • 那些年那些事
关于
  • 分类
  • 标签
  • 归档
  • 闲谈

  • 语言

  • 数据库及分布式存储

  • Web、服务器安全

  • 工具

  • 开发问题集锦

    • 开发问题集锦
      • VSCODE
      • Python
      • GDAL
      • EDM问题
      • MIKE模型适配器
      • HEC-RAS模型适配器
      • jsdelivr CDN 访问不了
      • WCF服务
      • 数据库及分布式存储
        • ORM
        • sqlserver
        • mysql
        • redis
  • 系统

  • 程序开发
  • 开发问题集锦
嗖嗖社区
2022-10-23

开发问题集锦

# VSCODE

  • ctrl+k ctrl+0 折叠当前全部代码
  • ctrl+shift+i 插入当前时间

# Python

whl包库 (opens new window)

# GDAL

  • 安装 miniconda (opens new window),修改源地址为阿里云镜像地址
conda init
conda config --set show_channel_urls yes

将以下地址,粘贴到 .condarc文件

show_channel_urls: false
channels:
  - https://mirrors.aliyun.com/anaconda/cloud/ursky
  - https://mirrors.aliyun.com/anaconda/cloud/stackless
  - https://mirrors.aliyun.com/anaconda/cloud/simpleitk
  - https://mirrors.aliyun.com/anaconda/cloud/rdkit
  - https://mirrors.aliyun.com/anaconda/cloud/rapidsai
  - https://mirrors.aliyun.com/anaconda/cloud/qiime2
  - https://mirrors.aliyun.com/anaconda/cloud/pyviz
  - https://mirrors.aliyun.com/anaconda/cloud/pytorch3d
  - https://mirrors.aliyun.com/anaconda/cloud/pytorch-test
  - https://mirrors.aliyun.com/anaconda/cloud/pytorch
  - https://mirrors.aliyun.com/anaconda/cloud/psi4
  - https://mirrors.aliyun.com/anaconda/cloud/plotly
  - https://mirrors.aliyun.com/anaconda/cloud/omnia
  - https://mirrors.aliyun.com/anaconda/cloud/ohmeta
  - https://mirrors.aliyun.com/anaconda/cloud/numba
  - https://mirrors.aliyun.com/anaconda/cloud/msys2
  - https://mirrors.aliyun.com/anaconda/cloud/mordred-descriptor
  - https://mirrors.aliyun.com/anaconda/cloud/menpo
  - https://mirrors.aliyun.com/anaconda/cloud/matsci
  - https://mirrors.aliyun.com/anaconda/cloud/intel
  - https://mirrors.aliyun.com/anaconda/cloud/idaholab
  - https://mirrors.aliyun.com/anaconda/cloud/fermi
  - https://mirrors.aliyun.com/anaconda/cloud/fastai
  - https://mirrors.aliyun.com/anaconda/cloud/dglteam
  - https://mirrors.aliyun.com/anaconda/cloud/deepmodeling
  - https://mirrors.aliyun.com/anaconda/cloud/conda-forge
  - https://mirrors.aliyun.com/anaconda/cloud/caffe2
  - https://mirrors.aliyun.com/anaconda/cloud/c4aarch64
  - https://mirrors.aliyun.com/anaconda/cloud/bioconda
  - https://mirrors.aliyun.com/anaconda/cloud/biobakery
  - https://mirrors.aliyun.com/anaconda/cloud/auto
  - https://mirrors.aliyun.com/anaconda/cloud/Paddle
  - https://mirrors.aliyun.com/anaconda/pkgs/r
  - https://mirrors.aliyun.com/anaconda/pkgs/msys2
  - https://mirrors.aliyun.com/anaconda/pkgs/main
  - https://mirrors.aliyun.com/anaconda/pkgs/free

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
  • 安装gdal
conda install gdal=3.4.2
1

[color=#6c1faf] geopandas=0.10.2;gdal=3.4.2;fiona=1.8.21


  • GDAL编译库 (opens new window)
  • shp文件字符串字段长度最大为254
  • 参考 (opens new window)

使用geopandas接口,依次安装: 1、gdal 2、fiona 3、geopandas


# EDM问题

  • EntityFramework 由原来的6.2.0和mysql 8.0.21,更新至6.4.4,mysql驱动更新至8.0.29,vs2017和vs2019出现了创建实体模型闪退的问题

vs2017、2019安装目录对应的mysql驱动为8.0.24,因此只能安装8.0.24及以下connector 但在本地开发连接远端服务器时,会报“Character set 'utf8mb3' is not supported by .Net Framework.” 因此,按此处理:生成实体方案是切换到8.0.24版,运行时切换至8.0.29版 SY.EDM工程的引用也切换至8.0.24版本 实体生成在sypcloud_v1, vs2019工程中实现 发布时在sypcloud工程把SY.EDM编译一下,确保上传的是8.0.29版本的dll

  • The given key was not present in the dictionary 问题解决方案 (opens new window)
  • 修改一下App.config文件,唤醒vs

# MIKE模型适配器

  • SY.MikelModelAdapter 为老的一套的接口
  • SY.MikelModelAdapterEx 为新的一套DHI开源的接口,编译须为x64

# HEC-RAS模型适配器

  • HEC River Analysis System COM组件引用,开发版本要与实际运行版本一致
  • 河网文件、边界文件、方案文件等,文件中有涉及版本号的,均需修改为运行环境的hecras版本号,否则会导致hecras运行错误。
  • 加载已发布到nuget上的hec-dss库
    • 添加nuget源地址:> https://www.hec.usace.army.mil/nexus/repository/dss/
    • nuget已发布的Hec-dss库对应的.net框架为4.7.2,如工程.net框架低于4.7.2则从nuget加载不了,需自行编译hec-dss
  • 编译hec-dss
    • 注意vc编译器的选择
    • 注意jdk库的路径
    • 注意ivf库的路径

# jsdelivr CDN 访问不了

  • 将http://cdn.jsdelivr.net替换为http://fastly.jsdelivr.net 就行了。如果这个也挂了,打开 https://ipaddress.com/website/raw.githubusercontent.com 将GitHub的ip地址复制到host文件 C:\Windows\System32\drivers\etc\hosts就行,就是麻烦点。

作者:每天学点黑科技 链接:https://www.zhihu.com/question/533766356/answer/2495374387 来源:知乎 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

# WCF服务

  • 提示:已尝试创建到达不支持 .Net 框架的服务的通道。可能遇到 HTTP 终结点。

检查服务端config文件baseAddress使用的端口是否被其他应用占用,换一个端口。

  • 服务启动失败

原因

64bit机器装VS2012时,默认的WcfSvcHost.exe是64位,不兼容加载x86的Dll

解决方法:

  1. 打开VS命令提示行

  2. 通过cd命令切换到WcfSvcHost.exe所在文件夹 (一般在安装目录下,如D:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE)

  3. 运行命令 corflags /32BIT+ /FORCE WcfSvcHost.exe

  4. WcfSvcHost.exe.config改为兼容2.0,否则服务调试时调用2.0程序集会出错

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <startup useLegacyV2RuntimeActivationPolicy="true"> 
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
  </startup>  
  <runtime>
    <DisableMSIPeek enabled="true"/>
  </runtime>
</configuration>
1
2
3
4
5
6
7
8
9

Vs2015的好像不行,直接用vs2012的覆盖,VS2017 执行步骤3、4。

# 数据库及分布式存储

# ORM

# entityframe

  • 连接数据库报错:基础程序在open上失败的原因

解决方法:捕获innerexception消息,根据消息提示进一步查找原因。

# sqlserver

  • 无法升级数据库 ‘某某数据库文件’,因为它是只读的,或者具有只读文件。请将数据库或文件设为可写,然后重新运行恢复操作。

将拟附加的数据库文件所在文件夹权限添加 everyone 角色

# mysql

  • Authentication to host '**' failed.

如连接字符串没有任何问题,可在连接字符串中加入SslMode=None;

connection string=&quot;server=127.0.0.1;user id=username;password=pwd;SslMode=None;persistsecurityinfo=True;port=3306;database=sypdb&quot;"
1
  • Retrieval of the RSA public key is not enabled for insecure connections

可在连接字符串中加入 AllowPublicKeyRetrieval=True;

# redis

  • Redis server非正常关闭导致缓存失效,可以修改以下配置参数

搜索找到配置文件:redis.windows-service.conf 修改以下参数值为on(默认为yes)

stop-writes-on-bgsave-error no
1
#开发问题集锦
上次更新: 2023/02/06, 11:05:22
Visiual Studio如何正确设置架构(x86、x64、AnyCPU)
电脑小知识

← Visiual Studio如何正确设置架构(x86、x64、AnyCPU) 电脑小知识→

最近更新
01
污染源调查的基本步骤
05-16
02
流域、区域污染源识别
05-16
03
区(流)域基本情况
02-01
更多文章>
Theme by Vdoing | Copyright © 2021-2024 嗖嗖社区 | MIT License | 京ICP备20020545号-1
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式