- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我们有一个基于导航的 WPF 应用程序。直接从 Visual Studio 运行时它工作正常,或者即使我们将文件复制到另一个目录或另一台计算机并在那里运行它。
我们使用 ClickOnce 和大多数工具在 Internet 上部署应用程序这通常不会造成任何问题。
然而,时不时地,它会完全卡住,你会得到经典的“应用程序 xxxx 没有响应”和无响应的 UI。
这不会每次都发生,只有在使用部署版本时才会发生。(即使我们在开发机器上测试它)。
As I am typing this message, we are starting and quiting the deployed version many times in order to try and reproduce the behaviour... sometimes it will happen 10 times in a row, and then it'll work fine the next 20 times. With no indication as to what might be causing it. (Just managed to make it happen)
为了向您展示我的意思,这是一个屏幕截图:
[ ][空]
双击列表框中的第一项时会发生这种情况:
LLCOverviewPage llcOverview = new LLCOverviewPage((Controller)this.lstControllers.SelectedItem);
this.NavigationService.Navigate(llcOverview);
应用程序永远保持这种状态,不会抛出任何异常。
LLCOverViewPage 的构造函数如下所示:
public LLCOverviewPage(Controller CurrentController)
{
InitializeComponent();
this.currentController = CurrentController.ToLightLinkController();
this.updateControllerInfo();
}
updateControllerInfo()方法显示页面信息,然后调用一个方法获取之前加载的更多信息来自 SQL Compact 3.5 数据库:
private void updateControllerInfo()
{
//Update the UI with general properties
this.lblDeviceName.Content = this.currentController.ShortName;
this.lblEthernetAddress.Content = this.currentController.Eth0.EthernetAddress.ToString();
this.lblTcpPort.Content = this.currentController.Eth0.TcpPort.ToString();
this.lblActuatorThroughputMode.Content = (this.currentController.Dali.ActuatorThroughputMode ? "Enabled" : "Disabled");
this.lblNetmask.Content = (this.currentController.Eth0.Netmask != null ? this.currentController.Eth0.Netmask.ToString() : String.Empty);
this.lblDefaultGateway.Content = (this.currentController.Eth0.DefaultGateway != null ? this.currentController.Eth0.DefaultGateway.ToString() : String.Empty);
//Update the UI with the ballasts
this.updateBallastList();
}
private void updateBallastList()
{
this.lstBallasts.ItemsSource = null;
List<BallastListViewItem> listviewItems = new List<BallastListViewItem>();
foreach (DaliBallast ballast in this.currentController.Dali.Ballasts.OrderBy(b => b.ShortAddress))
{
listviewItems.Add(new BallastListViewItem(ballast,this.currentController.SerialNumber));
}
this.lstBallasts.ItemsSource = listviewItems;
}
就是这样。构建页面时不会发生任何其他事情。
毫无异常(exception),因为应用程序没有崩溃,为了找到问题所在,我几乎没有什么可继续的。
SQL Compact 数据库存储在用户应用程序文件夹中,所以部署版本使用与普通版本相同的数据库,那里没有区别。
所以,需要说明的是,这个问题只发生在部署版本中!(在装有 Windows XP 和 Windows Vista 的不同机器上测试过)
关于可能导致此类事情发生的任何想法,或者我可能会尝试什么来追查这个问题?
更新
Using some good old debugging (writing log information to a file) I was able to determine all of my code succesfully excecutes and the application only freezes after that.
因此,如果您再看一下正在创建的页面的构造函数:
public LLCOverviewPage(Controller CurrentController)
{
InitializeComponent();
this.currentController = CurrentController.ToLightLinkController();
this.updateControllerInfo();
}
在 this.updateControllerInfo() 之后是应用程序卡住的地方时。这会超出我的代码范围吗?也许是 WPF 错误?
更新 2我检查了 Windows 中的应用程序事件日志,它是这样说的:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Application Hang" />
<EventID Qualifiers="0">1002</EventID>
<Level>2</Level>
<Task>101</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2008-11-04T15:55:55.000Z" />
<EventRecordID>1630</EventRecordID>
<Channel>Application</Channel>
<Computer>DEVTOP</Computer>
<Security />
</System>
<EventData>
<Data>LLCControl.exe</Data>
<Data>1.0.0.0</Data>
<Data>2f4</Data>
<Data>01c93e95c29f9da5</Data>
<Data>20</Data>
<Binary>55006E006B006E006F0077006E0000000000</Binary>
</EventData>
</Event>
二进制文本说:未知,猜猜我完全被坑了......
更新 3如果我将列表框的事件处理程序代码更改为:
LLCOverviewPage llcOverview = new LLCOverviewPage((Controller)this.lstControllers.SelectedItem);
MessageBox.Show("Navigating Now");
this.NavigationService.Navigate(llcOverview)
它告诉我应用程序仅在导航时卡住!
更新 4我将一些事件处理程序连接到 NavigationService。当事件被触发时,处理程序只需写入日志。结果如下所示:
17:51:35 Navigating 17:51:35 Navigated 17:51:35 LoadCompleted
那么为什么这会被遗忘呢?
最佳答案
我已经能够将问题追溯到代码当数据绑定(bind)发生时调用,这保证了在这里发现一个新问题:
SQL 2 LINQ query (called by databinding) completely freezing WPF application
关于c# - 运行 ClickOnce 部署版本的 WPF 应用程序时的奇怪行为,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/262017/
我有一个使用 ClickOnce 部署的 WinForms 应用程序。在应用程序项目中,我将一些文件标记为“内容”,它们在“发布”设置的“应用程序文件”对话框中也标记为“数据文件”。我还有一些标记为“
理想情况下,调用 setup.exe 时根本不会弹出任何窗口,但最好是让用户不必在安装先决条件和其他选项时单击“确定”。甚至可以使用 ClickOnce ? 最佳答案 附加文件 附加组件(文件和 DL
我部署了一个新版本的 ClickOnce 应用程序 我在测试客户端机器上打开我的 ClickOnce 应用程序 不提供升级 我关闭我的 ClickOnce 应用程序并重新打开它,现在提供升级 为什么我
我们部署了一个名为“Its Our App”的 Winforms 应用程序。 人们将其称为 IOA。我想保留快捷方式的全名,但我看到许多用户在键盘上按下 Windows 键,输入 IOA,然后奇怪地说
好的,我有一个 Windows Forms使用 ClickOnce 发布的应用程序到http://MyDevComputer1/DevPublishFolder/ ,所以部署链接是 http://My
.NET ClickOnce 应用程序被部署到 C:\Documents and Settings\\Local Settings\Apps\2.0 的子文件夹中。在开发过程中,我们倾向于进行大量的小
自 ClickOnce每个配置文件而不是每台计算机安装,有没有办法同时从多个配置文件卸载单个 ClickOnce 客户端应用程序? 我们有一个 ClickOnce 应用程序,我们希望使用标准 MSI
对于不同的环境,我们有多个具有不同配置文件的相同程序集的部署。我们将这些打包成具有不同部署标识(Program_ENV1、Program_ENV2 等)的单独 ClickOnce 部署。 应用程序标识
我有一个简单的 WinForms 应用程序,我正在使用 ClickOnce 在内部部署它。主应用程序有一个依赖程序集,该程序集有一些 xml 模板文件在构建属性中标记为“内容”和“始终复制”,但是如果
有没有办法在不提示用户的情况下安装 ClickOnce 应用程序?我说的是用户第一次运行应用程序时得到的“运行/不运行”。 似乎有一些线索here但我相信这是关于跳过“海拔”(UAC)和安全提示,而不
我有一个 ClickOnce 应用程序,在它安装到客户端机器上后,它第一次启动时会创建文件夹 X、Y 和 Z。 现在,当用户开始使用应用程序时,他/她会在这些文件夹中创建各种文件。稍后应用程序的新版本
有没有一种方法(hacky 可以)允许用户返回到 ClickOnce 的先前版本网络部署的应用程序? 我查看了文档和API,似乎没有办法。您可以选择性地选择是否要更新,但一旦更新,似乎就无法返回。 最
我了解 ClickOnce 应用程序可以自动更新。但是,Microsoft 提供的选项并不是我想要的。 如果我在应用程序启动前检查版本,启动会比较慢。 如果我在应用程序启动后检查版本,直到下次启动时我
在我的 ClickOnce c# 应用程序中,如何判断用户是否刚刚更新了应用程序?我愿意在用户下载更新后显示发行说明或更改日志。 我知道如何以编程方式(拼写?)检测更新是否可用,并手动执行更新。那时我
为我的 ClickOnce 应用程序的用户提供降级到以前版本的方法的推荐方法是什么? (以防新版本不能在他们的机器上运行) 最佳答案 在 ClickOnce 部署设置中,将最低要求版本保留为旧版本。这
我了解 ClickOnce 应用程序可以自动更新。但是,Microsoft 提供的选项并不是我想要的。 如果我在应用程序启动前检查版本,启动会比较慢。 如果我在应用程序启动后检查版本,直到下次启动时我
众所周知,当我们双击已安装的 clickonce 应用程序时,会弹出一个“clickonce 屏幕”,上面写着“正在验证系统要求”。然后如果服务器中有更新版本,clickonce 更新本地安装的版本,
我即将部署一个 ClickOnce 应用程序供内部使用。我将亲自将应用程序分发给一组受信任的用户。我知道可以对 ClickOnce list 进行签名,但是当用户信任来源时是否需要签名? 不签署 li
我们非常接近以 ClickOnce 部署的形式发布我们的第一个产品,但是有几个烦人的问题我似乎无法解决...... 我知道在 ClickOnce 部署 list 中,ClickOnce 需要 Wind
我正在为客户端开发一个 Windows .NET 4 桌面应用程序,并且正在考虑使用 ClickOnce从客户的网站部署它。我还计划从他们的网站部署应用程序版本升级。 我已经阅读了 StackOver
我是一名优秀的程序员,十分优秀!