开发者社区> 问答> 正文

为什么最新版本GetProducts()方法会出错,此方法在核心项目中,导致无法调用任何接口

这是项目aliyun-net-sdk-core下InternalEndpointsParser.cs文件中的一个方法:
public List GetProducts()
{

        Type type = MethodBase.GetCurrentMethod().DeclaringType;
        string _namespace = type.Namespace;
        Assembly _assembly = Assembly.GetExecutingAssembly();
        string resourceName = _namespace + "." + BUNDLED_ENDPOINTS_RESOURCE_PATH;
        Stream stream = _assembly.GetManifestResourceStream(resourceName); 
        //为什么上一行始终返回了null ?导致下一行执行出错了?????
        return ParseProducts(stream);

}

展开
收起
木刀 2018-11-19 15:39:57 1908 0
1 条回答
写回答
取消 提交回答
  •     private XmlDocument LoadEndpointDocument()
        {
            Assembly _assembly = Assembly.GetExecutingAssembly();
            string resourceName = $"{_assembly.GetName().Name}.{文件夹路径}.{BUNDLED_ENDPOINTS_RESOURCE_PATH}";
            Stream stream = _assembly.GetManifestResourceStream(resourceName);
            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.Load(stream);
            return xmlDoc;
        }
    2019-07-17 23:15:26
    赞同 展开评论 打赏
问答地址:
问答排行榜
最热
最新

相关电子书

更多
fibjs 模块重构从回调到协程--陈垒 立即下载
fibjs 模块重构从回调到协程 立即下载
面向失败设计 立即下载