构建“发布”时出错在我的项目中(具有自定义控件)
我正在构建一个图像查看器应用程序,在我的项目中包含 2 个自定义控件。
- 包含图像缩略图+图像名称的列表框 来自 http://www.codeproject.com/KB/combobox/imagelistbox.aspx
和
- 具有缩放和平移功能的图片框控件 来自 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.
- A list box with the image thumbnails + image name
from http://www.codeproject.com/KB/combobox/imagelistbox.aspx
and
- 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这可能是因为 Windows 窗体控件“公共控件集合属性”和控件命名空间“Controls.Development”之间存在冲突,请尝试为该命名空间创建一个 elias,例如
:
行
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:
or
in line
global::Controls.Development;