473,654 Members | 3,280 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

compile error after defining custom attribute

I get 2 compile errors on assembly attributes after creating a custom
attribute. If I comment out the attribute, the errors go away. I don't get
it because my attribute specifies class usage, not assembly usage.

Assembly attribute 'System.Runtime .InteropService s.GuidAttribute ' is not
valid: Assembly custom attribute
'System.Runtime .InteropService s.GuidAttribute ' was specified multiple times
with different values

Attribute 'System.CLSComp liantAttribute' cannot be specified more than once
in this project, even with identical parameter values.

Here is the definition of the custom attribute I created:

<System.Attribu teUsage(System. AttributeTarget s.Class, Inherited:=Fals e,
AllowMultiple:= True)> _

Public Class ApplicationType Attribute

Inherits System.Attribut e

Public Enum ApplicationPurp oseAttributeEnu m

BudgetAttribute Enum = 1

ConfigurationAt tributeEnum = 2

MainMenuAttribu teEnum = 3

ReportsAttribut eEnum = 4

SecurityAttribu teEnum = 5

End Enum

Private AttributeEnum As ApplicationPurp oseAttributeEnu m

Public Sub New(ByVal AppType As ApplicationPurp oseAttributeEnu m)

AttributeEnum = AppType

End Sub

Public ReadOnly Property IsConfiguration () As Boolean

Get

Return (AttributeEnum =
ApplicationPurp oseAttributeEnu m.Configuration AttributeEnum)

End Get

End Property

Public ReadOnly Property IsSecurity() As Boolean

Get

Return (AttributeEnum =
ApplicationPurp oseAttributeEnu m.SecurityAttri buteEnum)

End Get

End Property

Public ReadOnly Property ApplicationAttr ibute() As
ApplicationPurp oseAttributeEnu m

Get

Return AttributeEnum

End Get

End Property

End Class

Nov 20 '05 #1
2 3524
I've simplified the attribute class, and added full namespaces,etc. , and
still get the compile errors...
<System.Attribu teUsage(System. AttributeTarget s.Class, Inherited:=Fals e,
AllowMultiple:= True)> _

Public Class ApplicationType Attribute

Inherits System.Attribut e

Public Enum ApplicationPurp oseAttributeEnu m

BudgetAttribute Enum = 1

ConfigurationAt tributeEnum = 2

MainMenuAttribu teEnum = 3

ReportsAttribut eEnum = 4

SecurityAttribu teEnum = 5

End Enum

Private AttributeEnum As
CECC.Financial2 000.Global.Inte rfaces.Applicat ionTypeAttribut e.ApplicationPu r
poseAttributeEn um

Public Sub New(ByVal AppType As
CECC.Financial2 000.Global.Inte rfaces.Applicat ionTypeAttribut e.ApplicationPu r
poseAttributeEn um)

AttributeEnum = AppType

End Sub

Public ReadOnly Property ApplicationAttr ibute() As
CECC.Financial2 000.Global.Inte rfaces.Applicat ionTypeAttribut e.ApplicationPu r
poseAttributeEn um

Get

Return AttributeEnum

End Get

End Property

End Class
Nov 20 '05 #2
Argh...guess I should have actually read the error message, and not tried to
put 2 & 2 together...

I consolidated 3 projects having child namespaces into a single project, and
put some of the project files into subdirectories, matching the namespace.
I also moved the old assemblyinfo.vb file into the subdirectory, but I
actually needed to delete it. :)
"Harry F. Harrison" <Ha************ @sbcss.k12.ca.u s> wrote in message
news:eX******** *****@tk2msftng p13.phx.gbl...
I get 2 compile errors on assembly attributes after creating a custom
attribute. If I comment out the attribute, the errors go away. I don't get it because my attribute specifies class usage, not assembly usage.

Assembly attribute 'System.Runtime .InteropService s.GuidAttribute ' is not
valid: Assembly custom attribute
'System.Runtime .InteropService s.GuidAttribute ' was specified multiple times with different values

Attribute 'System.CLSComp liantAttribute' cannot be specified more than once in this project, even with identical parameter values.

Here is the definition of the custom attribute I created:

<System.Attribu teUsage(System. AttributeTarget s.Class, Inherited:=Fals e,
AllowMultiple:= True)> _

Public Class ApplicationType Attribute

Inherits System.Attribut e

Public Enum ApplicationPurp oseAttributeEnu m

BudgetAttribute Enum = 1

ConfigurationAt tributeEnum = 2

MainMenuAttribu teEnum = 3

ReportsAttribut eEnum = 4

SecurityAttribu teEnum = 5

End Enum

Private AttributeEnum As ApplicationPurp oseAttributeEnu m

Public Sub New(ByVal AppType As ApplicationPurp oseAttributeEnu m)

AttributeEnum = AppType

End Sub

Public ReadOnly Property IsConfiguration () As Boolean

Get

Return (AttributeEnum =
ApplicationPurp oseAttributeEnu m.Configuration AttributeEnum)

End Get

End Property

Public ReadOnly Property IsSecurity() As Boolean

Get

Return (AttributeEnum =
ApplicationPurp oseAttributeEnu m.SecurityAttri buteEnum)

End Get

End Property

Public ReadOnly Property ApplicationAttr ibute() As
ApplicationPurp oseAttributeEnu m

Get

Return AttributeEnum

End Get

End Property

End Class

Nov 20 '05 #3

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

Similar topics

0
1309
by: Gianni Mariani | last post by:
Below is an example of how to do static type-checking of an erroneous set of input masks. The drawback is that it's a little too verbose and non-trivial to understand and to make it truly I'd like to hear if you think this is overboard or you'd like to see more code like this ? ------------------------------------------------------------------------
5
3808
by: Brice Prunier | last post by:
Here under 4 schemas i'm working with ( it may be long: sorry...) The context is the following : Resident.xsd imports Person.xsd and includes Common.xsd ( anonimous schema: no TargetNamespace ) Person.xsd includes Common-Naming.xsd ( anonimous schemas ) Common-Naming.xsd includes common.xsd ( both are anonimous schemas ) Compilation of Resident.xsd raise the following exception: "System.Xml.Schema.XmlSchemaException: The attribute 'oid'...
9
5294
by: Tyler | last post by:
I am attempting to extend a legacy VB6 application by making it use a .NET component written in C# exposed through COM interop. Everything appeared to be going well (VB application creates the .NET component instead of the legacy VB6 component and invokes some methods successfully) until I hit a snag. For one method that is being invoked by the VB6 application, the method takes 2 parameters (string values) and a custom interface. ...
6
635
by: Javier Cortés Cortés | last post by:
i am getting this error when i am trying to access any file(with the ext. aspx) from my remote server. the error is : Server Error in '/' Application. ---------------------------------------------------------------------------- ---- Runtime Error Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application
4
5386
by: tommy | last post by:
hello everbody, i write a little asp-application with forms-authentication. i copy my aspx-files with web.config to my webspace and i get the error above... i tried to set the custom-errors-tag ="off" but nothing happens.... what is my failure????
7
2853
by: Yongsub Eric Shin | last post by:
Hi. I'm just a beginner in ASP.Net. I started writing codes and I keep on getting this Runtime Error page, where it says "Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
6
1980
by: Terry Olsen | last post by:
I would like to put program info in my applications' about screen such as compile date & time, lines of code, etc. Is there a way to do this automatically when I compile?
5
1776
by: Sadeq | last post by:
Is it possible to define custom attributes for arrays? And if so, how can I retrieve them? I mean I want to define sth like: int MyArray; and then retrieve the value of the custom attribute on demand. I used the GetCustomAttributes method on MyArray, but the results "length" was
2
6351
by: akhilesh.noida | last post by:
I am trying to compile glibc-2.5 for ARM based board. But I am getting errors while configuring it. Please check and give your inputs for resolving this. configure command : $ ../glibc-2.5/configure --prefix=/mnt/new/Mars/glibc_HQ_test/GLIBC/ install/ --with-__thread --enable-kernel=2.6.11 --enable-shared
0
8376
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8290
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8708
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7307
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6161
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4149
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4294
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2716
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1596
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.