我正在为 Windows Phone 写一个 Silverlight 透视应用程序,使用 VS2010。我刚刚从 msdn 这里 添加了示例代码。现在每当我重新加载设计器时,都会出现异常:
无法确定调用者的应用程序标识。
at System.IO.IsolatedStorage.IsolatedStorage.InitStore(IsolatedStorageScope scope, Type appEvidenceType)
at System.IO.IsolatedStorage.IsolatedStorageFile.GetStore(IsolatedStorageScope scope, Type applicationEvidenceType)
at System.IO.IsolatedStorage.IsolatedStorageSettings.get_ApplicationSettings() at SettingsSample.AppSettings..ctor() in C:..\Settings.cs:line 34
这是构造函数中第 34 行的代码:
Visual Studio/Windows Phone SDK 是否存在漏洞?
public AppSettings()
{
// Get the settings for this application.
try
{
settings = IsolatedStorageSettings.ApplicationSettings;
}
catch (System.Exception ex)
{
MessageBox.Show(ex.Message);
}
}
我添加了try-catch以查看发生了什么。
我怀疑Visual Studio(调用者)正在尝试运行代码,但没有任何应用程序(应用程序身份)相关联,因此失败了。也许是这样吗?
你有什么想法吗?