Reputation: 667
how can we create CLSID for DLL using regasm.exe
Actaully i want to use a windows application on web, i found an article on that, im posting the link below
http://www.codeproject.com/Articles/14276/Using-Windows-Application-on-web
In the above article im facing issue near the 10th step where it states that:: "Now by using the "regasm.exe" create and place the CLSID of your dll in the registry the exe file which is in the location "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\ "."
im not sure how to create the CLSID for the dll?
Upvotes: 1
Views: 6216
Reputation: 1364
A CLSID is a globally unique ID (=GUID). It has a fixed format (see the Answer from Joe) and is "random". You can create one with guidgen.exe. Many Editors and IDE's have functionality to create a GUID. With regasm you can register the GUID (=CLSID then) of your COM class object in windows.
Upvotes: 0
Reputation: 124746
A CLSID identifies a COM class object, not a DLL.
When you register your assembly using regasm, a CLSID will be registered for each ComVisible class in your assembly.
You can specify the CLSID you want by placing a Guid
attribute on a class:
[GuidAttribute("12345678-9012-3456-7890-123456789abc")]
public sealed class MyComVisibleClass ...
or if you don't use this attribute it will be generated automatically.
If it's generated automatically, you can inspect the type library generated by regasm using "OLE Viewer" or similar.
Upvotes: 1
Reputation: 14591
By calling
regasm.exe /codebase /tlb whatever.dll
depending on your needs, /codebase or /tlb might not be needed (i.e. you can also try just regasm.exe whatever.dll
).
Upvotes: 0