我学习卡利微并尝试使用的EventAggregator从官方网站.
但是,我有一个例外
"没有为此对象定义无参数构造函数."
消息本身很清楚,但示例中也没有包含无参数构造函数.如果我添加一个,带有参数的构造函数不会被命中,IEventAggregator仍然没有正确注入.
添加无参数构造函数后,这是我的发布者VM(没有它,将抛出异常):
public MainViewModel() { }
public MainViewModel(IEventAggregator ea) : this()
{
eventAggregator = ea;
}
Run Code Online (Sandbox Code Playgroud)
这是我正在使用的引导程序:
public class AppBootstrapper : Bootstrapper<MainViewModel>
{
private readonly SimpleContainer container = new SimpleContainer();
protected override void Configure()
{
container.Singleton<IEventAggregator, EventAggregator>();
}
}
Run Code Online (Sandbox Code Playgroud)
这是CM的例子:
// Creating the EventAggregator as a singleton.
public class Bootstrapper : BootstrapperBase {
private readonly SimpleContainer _container =
new SimpleContainer();
// ... Other Bootstrapper Config
protected override void Configure(){
_container.Singleton<IEventAggregator, EventAggregator>(); …Run Code Online (Sandbox Code Playgroud) 我希望在运行从SpringSource下载的GGTS 3.4的setup.exe之后,分享我如何解决代理问题以在我公司的PC中设置GGTS的知识(通过google搜索整整一天的www;))
问题:
当我在IDE安装后开始构建我的hello world项目时,GGTS会提示我此错误消息:"错误无法解析依赖项".怎么解决?