Closed agebullhu closed 3 years ago
的确存在加载异常导致服务无法启动的问题,这里是需要加个异常控制确保服务可以继续运行。
我的情况并不是你描述的那样,我的是fastapi正常启动了,wpf页面(后期载入的)加载时,wpf引擎报找不到资源,uri解析出错。所以我才会有希望通过配置来关闭程序集的嵌入资源扫描,至少这种情况下,fastapi仅丧失了支持嵌入资源的功能(可以通过静态文件来解决),其他功能都不受影响。
此功能已更新v1.9.4.3
可以在代码中添加以下属性,组件即不加载程序集资源。
[assembly: NotLoadResource]
在HttpApiServer类的Open方法的如下代码执行后,WPF资源会查找失败 if (mAssemblies != null) { foreach (System.Reflection.Assembly assembly in mAssemblies) { mResourceCenter.LoadManifestResource(assembly); } } mResourceCenter.LoadManifestResource(typeof(HttpApiServer).Assembly); 为保证WPF资源比较复杂的场景,建议此操作作为一个可配置项,用来规避这个BUG。 目的我是注释源代码来使用。 致敬你们为开源社区做出的贡献,Beetlex是一个非常优秀的工具。