基于arcpro3.0.2运行报错问题:不能加载文件System.Text.Encoding.CodePages, Version=8.0.0.0
报错问题描述:
基于arcpro3.0.2运行报错问题:
Could not load file or assembly 'System.Text.Encoding.CodePages, Version=8.0.0.0
解决办法:
重新拷贝打包生成目录:D:\cwgis_arcpro302\Debug\net6.0-windows到arcpro安装bin下
C:\Program Files\ArcGIS\Pro\bin
NuGet包下载包版本冲突问题:采用降底DLL版本来解决版本冲突
NuGet包下载包5.0.0: System.Text.Encoding.CodePages
代码中先加载Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
下面为解决了postgreSQL数据库访问后的版本号列表
//===============================================
MySql.Data(8.0.32.1)
Npgsql(6.0.11)
SqlSugarCore.Dm(8.5.0)
System.Data.OleDb(8.0.0)
System.Data.OracleClient(1.0.8)
System.Data.SQLite(1.0.118)
System.Text.Encoding.CodePages(5.0.0)
System.Text.Json(6.0.0)
//===============================================
其中主要是更新cwgis_arcpro302.deps.json文件和相关依赖
其中 "System.Text.Encoding.CodePages": "8.0.0",
改为"System.Text.Encoding.CodePages": "5.0.0",
最好采取方法:重新拷贝打包生成目录到arcpro\bin目录下
"targets": {
".NETCoreApp,Version=v6.0": {},
".NETCoreApp,Version=v6.0/win10-x64": {
"cwgis_arcpro302/1.0.0": {
"dependencies": {
"MySql.Data": "8.0.32.1",
"Npgsql": "6.0.11",
"SqlSugarCore.Dm": "8.5.0",
"System.Data.OleDb": "8.0.0",
"System.Data.OracleClient": "1.0.8",
"System.Data.SQLite": "1.0.118",
"System.Text.Encoding.CodePages": "5.0.0",
"System.Text.Json": "6.0.0",
"Aspose.Cells": "18.4.0.0",
"Microsoft.Office.Interop.PowerPoint": "12.0.0.0",
"Microsoft.Win32.SystemEvents.Reference": "8.0.0.0",
"NewLife.Core": "10.9.2024.402",
"NPOI": "1.2.3.0",
"office": "12.0.0.0",
"STSdb6": "1.0.0.0"
},
"runtime": {
"cwgis_arcpro302.dll": {}
}
本blog地址:https://blog.csdn.net/hsg77