Guids in VS.NET 2005

F

Fredo

I'm just curious, how do other people get new Guids to put in their code (if
you ever use them).

As I was just pasting in about my 2000th Guid from the "Create GUID" tool,
the question occurred to me; Why in the hell by VS.NET 2005 can they not
bother to update the Create GUID tool to simply spit out a Guid that doesn't
require editing? The least butchered version you can get still has
parenthesis around it which, for C#, means you have to get rid of the
parenthesis.

I mean, it's not a big deal, it's just an annoyance. I mean, really, how
much work could it possibly be to add a 5th option to Create GUID to have it
spit out a clean Guid?
 
P

Peter Duniho

[...]
I mean, it's not a big deal, it's just an annoyance. I mean, really, how
much work could it possibly be to add a 5th option to Create GUID to
have it
spit out a clean Guid?

How much work indeed?

But, the Create GUID tool wasn't written for .NET. It's been around
longer than that, so it's not surprising it doesn't emit some
..NET-specific format for a GUID. It's just a simple little tool, and if
you don't like it, just write your own.

Given that the .NET Guid class has a nice static NewGuid() method that you
can use to generate GUIDs, it should be trivial for you to write a tool
for your own use that generates GUIDs in whatever format you need them.

Pete
 
F

Fredo

Peter,

Of course, you're right. I know, Create GUID showed up in VS for all the
old C++ COM stuff. But surely the source is lying around. Someone could go
in and add a 5th option. Wouldn't that be better than me and you and whoever
else resorting to writing their own tool to do it (or just putting up with
Create GUID).

I dunno, it's just a little annoyance that's bugging me 'cause I've been
having to copy so many guids...


Peter Duniho said:
[...]
I mean, it's not a big deal, it's just an annoyance. I mean, really, how
much work could it possibly be to add a 5th option to Create GUID to
have it
spit out a clean Guid?

How much work indeed?

But, the Create GUID tool wasn't written for .NET. It's been around
longer than that, so it's not surprising it doesn't emit some
.NET-specific format for a GUID. It's just a simple little tool, and if
you don't like it, just write your own.

Given that the .NET Guid class has a nice static NewGuid() method that you
can use to generate GUIDs, it should be trivial for you to write a tool
for your own use that generates GUIDs in whatever format you need them.

Pete
 
D

DeveloperX

Peter,

   Of course, you're right. I know, Create GUID showed up in VS for all the
old C++ COM stuff. But surely the source is lying around. Someone could go
in and add a 5th option. Wouldn't that be better than me and you and whoever
else resorting to writing their own tool to do it (or just putting up with
Create GUID).

   I dunno, it's just a little annoyance that's bugging me 'cause I'vebeen
having to copy so many guids...


[...]
I mean, it's not a big deal, it's just an annoyance. I mean, really, how
much work could it possibly be to add a 5th option to Create GUID to
have it
spit out a clean Guid?
How much work indeed?
But, the Create GUID tool wasn't written for .NET.  It's been around
longer than that, so it's not surprising it doesn't emit some
.NET-specific format for a GUID.  It's just a simple little tool, and if
you don't like it, just write your own.
Given that the .NET Guid class has a nice static NewGuid() method that you
can use to generate GUIDs, it should be trivial for you to write a tool
for your own use that generates GUIDs in whatever format you need them.

Why not just write a GUID generator as a VS plug in? follow the wizard
and paste this into the exec method in the obvious place.

TextSelection selection =
(TextSelection)_applicationObject.ActiveDocument.Selection;
EditPoint point = selection.ActivePoint.CreateEditPoint();
point.Insert(Guid.NewGuid().ToString());

You might need to tweak it a bit, but that's the jist.
 
W

Willy Denoyette [MVP]

Fredo said:
I'm just curious, how do other people get new Guids to put in their code
(if you ever use them).

As I was just pasting in about my 2000th Guid from the "Create GUID" tool,
the question occurred to me; Why in the hell by VS.NET 2005 can they not
bother to update the Create GUID tool to simply spit out a Guid that
doesn't require editing? The least butchered version you can get still has
parenthesis around it which, for C#, means you have to get rid of the
parenthesis.

I mean, it's not a big deal, it's just an annoyance. I mean, really, how
much work could it possibly be to add a 5th option to Create GUID to have
it spit out a clean Guid?

There are two tools to generate uuid's, guidgen and uuidgen. When you need
to generate a lot of non-formatted sequential guid's, then uuidgen is better
suited for the job.

http://msdn2.microsoft.com/en-us/library/aa373928.aspx

Willy.
 
J

John B

Fredo said:
I'm just curious, how do other people get new Guids to put in their code (if
you ever use them).

As I was just pasting in about my 2000th Guid from the "Create GUID" tool,
the question occurred to me; Why in the hell by VS.NET 2005 can they not
bother to update the Create GUID tool to simply spit out a Guid that doesn't
require editing? The least butchered version you can get still has
parenthesis around it which, for C#, means you have to get rid of the
parenthesis.

I mean, it's not a big deal, it's just an annoyance. I mean, really, how
much work could it possibly be to add a 5th option to Create GUID to have it
spit out a clean Guid?
I actually wrote a console app that just created a new guid and copied
it to the clipboard.
Then I'd just run it from quick-launch.

JB
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top