473,289 Members | 1,808 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,289 software developers and data experts.

Guid not working?

Hey all,

I need to add a Guid to my class. In a tutorial I saw this was easy:

[Guid("16369924-5F32-4E26-AE89-8308B5C162E2")]
class someClass
{ ... }

However, I get the error "The type or namespace name 'Guid' could not be
found (are you missing a using directive or an assembly reference?)"
I'm doing it exactly the same way as in the tutorial but apparantly I'm the
only one having troubles with it. I'm using the System namespace in which
the Guid class is, but even if I use [System.Guid("xxx-etc")] it's not
working. Am I doing something wrong? And I don't have the 'Create Guid' in
the Tools menu either every website is talking about.

I hope someone can clear this up for me.

Thanks,

Razzie
Nov 16 '05 #1
3 10070
Hi Razzie,

You are actually applying an atttribute to someClass. When you do so, the
attribute name you use actually refers to an Attribute type. In your case,
you are really referring to the GuidAttribute attribute type which exists in
the System.Runtime.InteropServices namespace. Add a using statement for this
namespace in your source file.

HTH,
Rakesh
"Razzie" wrote:
Hey all,

I need to add a Guid to my class. In a tutorial I saw this was easy:

[Guid("16369924-5F32-4E26-AE89-8308B5C162E2")]
class someClass
{ ... }

However, I get the error "The type or namespace name 'Guid' could not be
found (are you missing a using directive or an assembly reference?)"
I'm doing it exactly the same way as in the tutorial but apparantly I'm the
only one having troubles with it. I'm using the System namespace in which
the Guid class is, but even if I use [System.Guid("xxx-etc")] it's not
working. Am I doing something wrong? And I don't have the 'Create Guid' in
the Tools menu either every website is talking about.

I hope someone can clear this up for me.

Thanks,

Razzie

Nov 16 '05 #2
GuidAttribute is in System.Runtime.InteropServices namespace. So, have
'using System.Runtime.InteropServices;' in your code.

"Razzie" <ra****@quicknet.nl> wrote in message
news:Ou*************@TK2MSFTNGP12.phx.gbl...
Hey all,

I need to add a Guid to my class. In a tutorial I saw this was easy:

[Guid("16369924-5F32-4E26-AE89-8308B5C162E2")]
class someClass
{ ... }

However, I get the error "The type or namespace name 'Guid' could not be
found (are you missing a using directive or an assembly reference?)"
I'm doing it exactly the same way as in the tutorial but apparantly I'm the
only one having troubles with it. I'm using the System namespace in which
the Guid class is, but even if I use [System.Guid("xxx-etc")] it's not
working. Am I doing something wrong? And I don't have the 'Create Guid' in
the Tools menu either every website is talking about.

I hope someone can clear this up for me.

Thanks,

Razzie

Nov 16 '05 #3
Thnx both replyers!

"Razzie" <ra****@quicknet.nl> wrote in message
news:Ou*************@TK2MSFTNGP12.phx.gbl...
Hey all,

I need to add a Guid to my class. In a tutorial I saw this was easy:

[Guid("16369924-5F32-4E26-AE89-8308B5C162E2")]
class someClass
{ ... }

However, I get the error "The type or namespace name 'Guid' could not be
found (are you missing a using directive or an assembly reference?)"
I'm doing it exactly the same way as in the tutorial but apparantly I'm
the only one having troubles with it. I'm using the System namespace in
which the Guid class is, but even if I use [System.Guid("xxx-etc")] it's
not working. Am I doing something wrong? And I don't have the 'Create
Guid' in the Tools menu either every website is talking about.

I hope someone can clear this up for me.

Thanks,

Razzie

Nov 16 '05 #4

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

Similar topics

6
by: BigDadyWeaver | last post by:
I am using the following code in asp to define a unique and unpredictable record ID in Access. <% 'GENERATE UNIQUE ID Function genguid() Dim Guid guid =...
24
by: Ilija_G | last post by:
Hi, Is there any replace for "Select @@identity" that could return "just inserted" GUID as a primary key? Has anyone tested what's faster, working with Guid or Autonumber ?
0
by: Doug | last post by:
I am working on an existing .NET (C Sharp) component that had a com interface that was used by a VB component. When it was originally written, it had the SSEAssemblyCom class below - minus the two...
3
by: Jeffry van de Vuurst | last post by:
Hi, I'm working with Guids as the primary key of some of my tables. In my code, I'm working with those Guids. Now I was wondering what is the best way to work with Guids (in terms of...
2
by: Nadav | last post by:
Hi, I am using the System.Type.GUID to identify similar types on different computers, one computer send the GUID through a socket while the other resolve the GUID and identify the type, when...
6
by: Mullin Yu | last post by:
hi, i have a web service that has file operations on Windows OS, and there may be a file concurrency issue if only one working directory e.g. c:\working therefore, i want to have a unique sub...
2
by: Lee Crabtree | last post by:
I've been wrapping an unmanaged class, and everything has gone well. That is...until now. I've hit a wall while trying to marshal the System::Guid type down into the unmanaged GUID structure...
1
by: Scott M. Lyon | last post by:
I've got a stored procedure that takes a few parameters as input parameters, and one output parameter (a uniqueidentifier). After the stored procedure call, I need to return that output parameter...
1
by: Scott M. Lyon | last post by:
I've got a stored procedure that takes a few parameters as input parameters, and one output parameter (a uniqueidentifier). After the stored procedure call, I need to return that output parameter...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.