473,385 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Custom Attribute, Type in non-GAC assembly and the Toolbox

Hello,

I am having a problem adding an assembly to the toolbox where it appears
VS2003 is unable to make sense of a type I am trying to initialise an
attribute with. Below is the simplest example which demonstrates the
problem.

I have two class library projects in my solution: BaseLib and ControlLib.
BaseLib declares a custom attribute and an enum, and ControlLib references
BaseLib and has a toolbox class and uses the custom attribute.

// BaseLib
using System;
namespace BaseLib {
[AttributeUsage(AttributeTargets.Class, AllowMultiple=true)]
public class cmiSecurityItemAttribute : Attribute {
// Ctor
public cmiSecurityItemAttribute(Type securityType) {
}
}
[FlagsAttribute]
public enum cmiSecurityAddEditDelete {Add=1, Edit=2, Delete=4}
}

// ControlLib
using System;
namespace ControlLib {
[BaseLib.cmiSecurityItemAttribute(typeof(BaseLib.cm iSecurityAddEditDelete))]
public class MyTextBox : System.Windows.Forms.TextBox {
}
}

If I try to add ControlLib to the toolbox, I receive the message "File or
assembly name BaseLib, or one of its dependencies, was not found.". If I
change the attibute use line to:
[BaseLib.cmiSecurityItemAttribute(typeof(bool))]
there is no problem adding ControlLib to the toolbox. So obviously VS can't
resolve the type BaseLib.cmiSecurityAddEditDelete when trying to add it to
the toolbox.

Does anyone have an idea what is going wrong here and a possible solution?
Is VS happy with "typeof(bool)" because it can find it in the GAC? I don't
want to add my BaseLib to the GAC. Any information would be much
appreciated.

TIA
Andrew Venmore


Nov 17 '05 #1
0 1133

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: xAvailx | last post by:
I apologize ahead of time for the long post... Background: Working on a CRM type custom application. The application is for an event management company. The company will provide the application...
5
by: Don | last post by:
Hi: I have created an xsd from my xml document. I pop this xsd in the following directory: C:\program files\Microsoft Visual Studio .NET 2003\Common7\Packages\schemas\xml. That give me...
3
by: Edward Diener | last post by:
I understand the syntax of custom attributes, but I have no idea what they are supposed to do. Anyone care to give me a clue as to their functionality ?
16
by: Bret Pehrson | last post by:
I've converted a non-trivial C++ library to managed, and get the following unhelpful linker error: Assignment.obj : error LNK2022: metadata operation failed (80131195) : Custom attributes are...
9
by: wardy1975 | last post by:
Hi All, Looking for a little expert advice on a few web standards issues. I am currently trying to understand the impact of web standards for a web application I work with. I have been doing a...
0
by: Carl Gilbert | last post by:
Hi I am trying to use a custom attribute that takes in an array or list of custom objects. Ths custom object has a text property and a type property. I have a custom attribute which has a...
1
by: bg | last post by:
hi all, I have this: // custom attribute internal class ThingAttribute : System.Attribute { ... } enum LotsOfThing
15
by: Jeff Mason | last post by:
Hi, I'm having a reflection brain fog here, perhaps someone can set me on the right track. I'd like to define a custom attribute to be used in a class hierarchy. What I want to do is to...
0
by: style | last post by:
In the following sample I declared a custom configuration section within my app.config. As you can see, the lastName attribute of the second employee element is missing: <?xml version="1.0"...
11
by: =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= | last post by:
I have worked with application settings in VS2005 and C# for awhile, but usually with standard types. I have been trying to store a custom container/class/type in an application setting and I have...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.