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?
Peter Duniho - 02 Mar 2008 01:05 GMT
> [...]
> 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
Fredo - 02 Mar 2008 01:42 GMT
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...
>> [...]
>> I mean, it's not a big deal, it's just an annoyance. I mean, really, how
[quoted text clipped - 14 lines]
>
> Pete
DeveloperX - 02 Mar 2008 13:28 GMT
> Peter,
>
[quoted text clipped - 25 lines]
>
> > Pete
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.
Willy Denoyette [MVP] - 02 Mar 2008 13:32 GMT
> I'm just curious, how do other people get new Guids to put in their code
> (if you ever use them).
[quoted text clipped - 9 lines]
> 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.
John B - 03 Mar 2008 00:41 GMT
> I'm just curious, how do other people get new Guids to put in their code (if
> you ever use them).
[quoted text clipped - 9 lines]
> 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