应用从未墓碑后,再次成功启动。没有抛出异常 [英] App Never launches successfully again after Tombstoning. No exception thrown

查看:217
本文介绍了应用从未墓碑后,再次成功启动。没有抛出异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有让我的应用程序立碑后恢复从开始/负载问题。



它未能在以下行:

  ServerCollection集合=的AppSettings .GetSetting(AppResources.settings_servercollection)为ServerCollection; 

这行是一个被称为内启动和激活功能。



的AppSettings类是该类这里:,但我修改它使用对象代替< T>

调试器似乎并没有进入AppSettings的功能。它还显示我期待在( AppResources.settings_servercollection )键的字符串,所以我不认为这是问题,无论是。



最后,没有异常抛出。我有一个尝试在应用程序的UnhandledException NavigationFailed 整款和断点,但我似乎永远到达任何人。



有没有其他人经历过这个,或者知道原因可能是什么?



编辑:只是想指出的是当然的应用程序后,清洗/重建/重新安装等
编辑工作的:我已经能够将其隔离到这一点:

  IsolatedStorageSettings设置= System.IO.IsolatedStorage.IsolatedStorageSettings.ApplicationSettings; 



我发现了通过将其放置在每一个的AppSettings的get / set函数,并且看到它死直接在进入功能后,该行。这就是说,任何想法?


解决方案

连载竟然是工作好了。真正的问题是,我有一些无限递归的,我是拯救一个属性怎么回事。

 公众解释<字符串对象>字典
{
得到
{
如果(_dictionary == NULL)
_dictionary =新词典<字符串对象>();
返回_dictionary;
}

{
字典=价值;
}
}



正如你或许可以看到,这是不打算有好下场的。太糟糕好像有在我以前也写过控制台C#应用程序没有一个StackOverflowException或任何东西。



无论如何,感谢您的帮助。希望谁比谁有这个问题可能会有所帮助。


I am having problems getting my app to restore/load from start after tombstoning.

It fails at the following line:

ServerCollection collection = AppSettings.GetSetting(AppResources.settings_servercollection) as ServerCollection;

This line is in a function that is called inside Launching and Activated.

The AppSettings class is this class Here:, but I modified it to use a object instead of a <T>.

The debugger does not seem to enter the AppSettings function. It also displays the string i'm expecting to key on (AppResources.settings_servercollection), so I do not think that is the problem either.

Lastly, no exceptions are thrown. I have the entire section in a try, and breakpoints inside UnhandledException and NavigationFailed of the application, but I never seem to arrive at any of them.

Has anyone else experienced this before, or know what the cause might be?

Edit: Just wanted to point out that of course the app works after Cleaning/Rebuilding/Reinstalling etc. Edit: I've been able to isolate it to this:

IsolatedStorageSettings Settings = System.IO.IsolatedStorage.IsolatedStorageSettings.ApplicationSettings;

I found that out by placing it in each the Get/Set functions of AppSettings, and seeing it die directly on that line after entering the function. That said, Any ideas?

解决方案

The serialization turned out to be working Okay. The real problem was that I had some infinite recursion going on in a property that I was saving.

public Dictionary<string, object> Dictionary
        {
            get
            {
                if (_dictionary == null)
                    _dictionary = new Dictionary<string, object>();
                return _dictionary;
            }
            set
            {
                Dictionary = value;
            }
        }

As you can probably see, that was not going to end well. Too bad there wasn't a "StackOverflowException" or anything like there is in the console C# applications i've written before.

Anyway, thanks for the help.. Hope anyone else who has this problem may find this helpful.

这篇关于应用从未墓碑后,再次成功启动。没有抛出异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆