We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
我用微软提供的mvvm包注册scoped周期的ExternalEventService服务时,在build容器时发生报错。错误信息如下:
System.IO.FileLoadException:“未能加载文件或程序集“Tuna.Revit.Extension, Version=2023.0.15.0, Culture=neutral, PublicKeyToken=null”或它的某一个依赖项。无效指针 (异常来自 HRESULT:0x80004003 (E_POINTER))”
服务注册代码如下:
services.AddScoped<IExternalEventService, ExternalEventService>();
注:Microsfot.CommunityToolkit.Mvvm版本8.2.0;Tuna.Revit.Extension版本2023.0.15.0;
Microsfot.CommunityToolkit.Mvvm
Tuna.Revit.Extension
The text was updated successfully, but these errors were encountered:
基于 Revit 外部事件的机制,扩展包里把 IExternalEventService 封装成了单例,可以尝试修改它的注册放置,示例如下
Revit
IExternalEventService
//在有效上下文进行实例化 IExternalEventService service = new ExternalEventService(); //注册单例服务,并传入实例 services.AddSingleton<IExternalEventService>(service);
Sorry, something went wrong.
找到问题了,是因为我在ioc容器build前调用了容器注入,和外部事件服务的声明周期没有关系。
No branches or pull requests
我用微软提供的mvvm包注册scoped周期的ExternalEventService服务时,在build容器时发生报错。错误信息如下:
服务注册代码如下:
注:
Microsfot.CommunityToolkit.Mvvm
版本8.2.0;Tuna.Revit.Extension
版本2023.0.15.0;The text was updated successfully, but these errors were encountered: