Closed OrchesAdam closed 6 years ago
运行环境 :
.NET Core 2.1 aliyun.acs.core.netcore 1.1.4.1 通过 nuget 安装
2.1
1.1.4.1
Aliyun.Acs.Dysmsapi
异常详细信息
System.Xml.XmlReader.CalcBufferSize(Stream input) System.Xml.XmlTextReaderImpl.InitStreamInput(Uri baseUri, string baseUriStr, Stream stream, byte[] bytes, int byteCount, Encoding encoding) System.Xml.XmlTextReaderImpl..ctor(string url, Stream input, XmlNameTable nt) System.Xml.XmlDocument.Load(Stream inStream) Aliyun.Acs.Core.Regions.InternalEndpointsParser.LoadEndpointDocument() Aliyun.Acs.Core.Regions.InternalEndpointsParser.GetEndpoints() Aliyun.Acs.Core.Profile.DefaultProfile.GetEndPointsFromLocal() Aliyun.Acs.Core.Profile.DefaultProfile.GetEndpoints(string regionId, string product, Credential credential, string locationProduct) Aliyun.Acs.Core.DefaultAcsClient.DoAction<T>(AcsRequest<T> request, bool autoRetry, int maxRetryNumber, IClientProfile profile) Aliyun.Acs.Core.DefaultAcsClient.DoAction<T>(AcsRequest<T> request) Aliyun.Acs.Core.DefaultAcsClient.GetAcsResponse<T>(AcsRequest<T> request)
经过简单的debug后发现 在InternalEndpointsParser这个类中,获取xml文件的方法
InternalEndpointsParser
Assembly.GetExecutingAssembly().GetManifestResourceStream(name)
取到的值为空,下面是调试窗口输出的信息
Assembly.GetExecutingAssembly().GetManifestResourceStream("Aliyun.Acs.Core.Regions.endpoints.xml") null
似乎是 xml的路径的问题,使用 下面这个方法
this.GetType().GetTypeInfo().Assembly.GetManifestResourceNames() {string[1]} [0]: "Aliyun.Acs.Core.NetCore.Regions.endpoints.xml"
返回的Aliyun.Acs.Core.NetCore.Regions.endpoints.xml能够获取到xml的信息,而程序获取的路径Aliyun.Acs.Core.Regions.endpoints.xml取不到
Aliyun.Acs.Core.NetCore.Regions.endpoints.xml
Aliyun.Acs.Core.Regions.endpoints.xml
运行环境 :
在使用
Aliyun.Acs.Dysmsapi
发送短信的时候,会出现异常异常详细信息
经过简单的debug后发现 在
InternalEndpointsParser
这个类中,获取xml文件的方法取到的值为空,下面是调试窗口输出的信息
似乎是 xml的路径的问题,使用 下面这个方法
返回的
Aliyun.Acs.Core.NetCore.Regions.endpoints.xml
能够获取到xml的信息,而程序获取的路径Aliyun.Acs.Core.Regions.endpoints.xml
取不到