Where can I get the GUID value of the interface and of the class for creating DLL in C#? I use Viusal Studio 2005.Please help.?
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
namespace Wrapper
{
[Guid("")] => Where can i get this???
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface _Service
{
[DispId(1)]
SearchResponse ExecuteSearch();
}
[Guid("")] => Where can i get this???
[ClassInterface(ClassInterfaceType.None)]
[ProgId("Wrapper.Service")]
public class Ebil : _Service
{
FactService ew;
public Ebil()
{
ew = new FactService();
}
public SearchResponse ExecuteSearch(SearchRequest searchRequest)
{
return ew.ExecuteSearch(searchRequest);
}
} }
Use a GUID-Generator of your choice, or follow this link.
GuidAttribute Class
Supplies an explicit System.Guid when an automatic GUID is undesirable.
It only has to be compatible with the Constructor of the Guid
class:
The string passed to the attribute must be in a format that is an acceptable constructor argument for the type Guid. To avoid conflicts with the type Guid, use the long name GuidAttribute explicitly. Only use an explicit GUID when a type must have a specific GUID. If the attribute is omitted, a GUID is assigned automatically.
The GUID
property of the Type
class. Try
typeof(_Service).GUID;
typeof(Ebil).GUID;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With