Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / March 2008

Tip: Looking for answers? Try searching our database.

Guids in VS.NET 2005

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Fredo - 01 Mar 2008 23:50 GMT
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

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.