我已经使用Genymotion大约一个月了,它运作良好.但是,在过去一周内,无论我的设置如何,我都收到了此错误:
"无法连接到您的虚拟设备!Genymotion现在将停止.请检查您的VirtualBox网络配置."
以及更多信息的链接:https: //cloud.genymotion.com/page/faq/#collapse-nostart
我按照那里的步骤,模拟器仍然无法正常工作.
我正在运行Google Nexus 4 - 4.4.2 - API 19 - 768x1280,并尝试使用不同API和类型的多个模拟器.我也在运行64位Windows 7操作系统.
我已经卸载并重新安装了Genymotion和VirtualBox,我仍然得到同样的错误.从VirtualBox中的模拟器预览,模拟器似乎正常运行,但Genymotion无法连接到此设备.从VirtualBox运行模拟器似乎运行良好; 不幸的是我无法从那里连接到Eclipse.
我该如何解决?问题是模拟器以前工作过,现在它不起作用.
我想在两个类之间映射:
public class A {
public IEnumerable<C> someList
}
Run Code Online (Sandbox Code Playgroud)
和
public class B {
public RepeatedField<D> someList
}
Run Code Online (Sandbox Code Playgroud)
其中 RepeatedField 是来自 Google.Protobuf.Collections 的一个类,用于处理 gRPC 数据。
编辑:事实证明,gRPC 通过其原型创建类的方式与创建类 B 并不完全一样。请参阅我的答案。
我像这样创建了一个 Automapper MappingConfiguration
return new MapperConfiguration(cfg =>
{
cfg.CreateMap<C, D>().ReverseMap();
cfg.CreateMap<A, B>().ReverseMap();
});
Run Code Online (Sandbox Code Playgroud)
然后它通过 ASP.NET Startup 类注册。
如果我在另一堂课上做这样的事情
A instanceA; // assume A's list has values inside
var listofD = this.mapper.Map<List<D>>(A.someList)
Run Code Online (Sandbox Code Playgroud)
它正确返回一个包含值的列表。然而:
A instanceA; // assume A's list has values inside
B instanceB = this.mapper.Map<B>(A);
Run Code Online (Sandbox Code Playgroud)
返回 B 的一个实例,但 instanceB 中的列表为空。我该如何解决?