Take the 2-minute tour ×

Is it possible to create GUIDS with a manually defined value?

I need to know the value of the GUID in advance to do some unit tests.

share|improve this question

1 Answer 1

up vote 3 down vote accepted
var guid = new Guid("62FA647C-AD54-4BCC-A860-E5A2664B019D");

Assuming you are using .Net

If you look at the MSDN documentation you will see a full list of all the different types of string representations of GUIDs that are possible.

share|improve this answer
Ok, thanks this works. I have tried it with different positions of the dashes. Are the dashes in .Net Guids always placed like this? Do different .Net Guid versions exist? –  niklr Oct 19 '12 at 20:19
@Moo - Yes, if you look at the MSDN docs (link above) then you will see examples. –  Josh Oct 19 '12 at 20:34

Your Answer


