使用onceclick发布winform项目时遇到的一个异常

如果使用onceclick升级的系统,在用户电脑上升级后不能正常进入系统,提示连接不到设备上,很多与excel有关的dll文件有异常等错误,

则有可能是因为发布该系统的时候电脑上有打开的excel等文件,关掉重新发布即可。

 

网上相关的一篇帖子如下:

When we deployed the recent build of our ClickOnce product we get the following error:

APPLICATION SUMMARY
* Installable application.
* Trust url parameter is set.
ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of https://install.dev.sl.bta.cc/PA/Assette%20Presentations.application resulted in exception. Following failure messages were detected:
    + Exception occurred during store operation.
    + Value does not fall within the expected range.
COMPONENT STORE TRANSACTION FAILURE SUMMARY
* Transaction at [9/17/2011 9:39:06 AM]
    - Staging of a component file (Office.dll) did not succeed.
    - Staging of a component (dev.Appender.dll.genman) did not succeed.
    - Staging of a component file (dev.Appender.dll) did not succeed.

There has been nothing changed except few references. Any idea why does this happen?

Thanks in advance.

 
 
 Answer   

The main reason of this is that the some files of the application is being opened or running during the the setup of the click once package. Make sure all the files of the application are closed

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
当然可以帮你绘制一个菱形的WinForms按钮控件。以下是一个基本的示例代码: ```csharp using System; using System.Drawing; using System.Windows.Forms; namespace DiamondButtonExample { public partial class DiamondButton : Button { public DiamondButton() { InitializeComponent(); SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true); FlatStyle = FlatStyle.Flat; FlatAppearance.BorderSize = 0; BackColor = Color.Transparent; Size = new Size(100, 100); } protected override void OnPaint(PaintEventArgs pevent) { GraphicsPath path = new GraphicsPath(); Point[] points = { new Point(ClientRectangle.Width / 2, 0), new Point(ClientRectangle.Width, ClientRectangle.Height / 2), new Point(ClientRectangle.Width / 2, ClientRectangle.Height), new Point(0, ClientRectangle.Height / 2) }; path.AddPolygon(points); Region = new Region(path); base.OnPaint(pevent); } } } ``` 要使用这个自定义的按钮控件,可以按照以下步骤进行: 1. 创建一个新的 WinForms 项目。 2. 在解决方案资源管理器中,右键单击项目,选择“添加”->“类”。 3. 将上述代码复制到新创建的类文件中。 4. 在主窗体或其他窗体上添加一个按钮控件。 5. 在设计器中选择该按钮控件,然后在属性窗口中找到“Modifiers”属性,并将其设置为“Public”。 6. 打开主窗体或其他窗体的代码文件,在顶部添加 `using DiamondButtonExample;`。 7. 在窗体的构造函数或加载事件中,使用如下代码创建和添加自定义的菱形按钮控件: ```csharp DiamondButton diamondButton = new DiamondButton(); Controls.Add(diamondButton); ``` 现在你应该能够在你的 WinForms 项目中看到一个菱形按钮控件了。你可以根据需要修改按钮的大小、颜色和其他属性。希望这能帮到你!

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值