构建“发布”时出错在我的项目中(具有自定义控件)

发布于 2024-11-17 05:10:55 字数 1473 浏览 3 评论 0原文

我正在构建一个图像查看器应用程序,在我的项目中包含 2 个自定义控件

  1. 包含图像缩略图+图像名称的列表框 来自 http://www.codeproject.com/KB/combobox/imagelistbox.aspx

  1. 具有缩放和平移功能的图片框控件 来自 http://www.codeproject.com/KB/GDI- plus/PanZoomExample.aspx?msg=2139768

我通过右键单击>选择项目>浏览...将它们添加到我的工具箱中...

当我更改构建配置发布应用程序无法构建并给出以下错误

1.“System.Windows.Forms.Control.Controls”是一个“属性”,但像“类型”一样使用 D:\My Corner\My Docs\Visual Studio 2010\Projects\myCanvas\myCanvas

in

private Controls.Development.ImageListBox listBox1;
this.listBox1 = new Controls.Development.ImageListBox();

2.'找不到类型或命名空间名称“Controls”(是否缺少 using 指令或程序集引用?)
D:\My Corner\My Docs\Visual Studio 2010\Projects\myCanvas\myCanvas\Form1.Designer.c

in

using Controls.Development;
private Controls.Development.ImageListBox listBox1;

3. 找不到类型或命名空间名称“ImageListBoxItem”(是否缺少 using 指令或程序集引用?) D:\My Corner\My Docs\Visual Studio 2010\Projects\myCanvas\myCanvas\Form1.cs

listBox1.Items.Add(new ImageListBoxItem(i.ImageName, imgList.Count - 1));

虽然当我将构建配置更改为“调试”时,应用程序构建良好。

请对此提供帮助。 谢谢你们!

I was building an Image Viewer Application with 2 custom controls in my project.

  1. A list box with the image thumbnails + image name
    from http://www.codeproject.com/KB/combobox/imagelistbox.aspx

and

  1. A picture box control with Zoom and pan capability
    from http://www.codeproject.com/KB/GDI-plus/PanZoomExample.aspx?msg=2139768

I added them both in my Toolbox by Right Click>Select Items>Browse...

When I change the build configuration to Release the application fails to build and gives the following errors:

1.'System.Windows.Forms.Control.Controls' is a 'property' but is used like a 'type'
D:\My Corner\My Docs\Visual Studio 2010\Projects\myCanvas\myCanvas

in

private Controls.Development.ImageListBox listBox1;
this.listBox1 = new Controls.Development.ImageListBox();

2.'The type or namespace name 'Controls' could not be found (are you missing a using directive or an assembly reference?)
D:\My Corner\My Docs\Visual Studio 2010\Projects\myCanvas\myCanvas\Form1.Designer.c

in

using Controls.Development;
private Controls.Development.ImageListBox listBox1;

3.The type or namespace name 'ImageListBoxItem' could not be found (are you missing a using directive or an assembly reference?)
D:\My Corner\My Docs\Visual Studio 2010\Projects\myCanvas\myCanvas\Form1.cs

in

listBox1.Items.Add(new ImageListBoxItem(i.ImageName, imgList.Count - 1));

Although when I change the Build configuration to "Debug" the application builds fine.

Please help on this.
Thanks guys!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

心奴独伤 2024-11-24 05:10:55

这可能是因为 Windows 窗体控件“公共控件集合属性”和控件命名空间“Controls.Development”之间存在冲突,请尝试为该命名空间创建一个 elias,例如

using ControlsDevelopment = Controls.Development;


global::Controls.Development;

This maybe because of conflict between the windows forms Controls "the public Controls collection property" and the Controls namespace "Controls.Development" try make an elias to that namespace like:

using ControlsDevelopment = Controls.Development;

or
in line

global::Controls.Development;

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文