Friday, September 22, 2006

Getting the identity of an assembly

Use the following code to create an identity object for an assembly. It can be used when passing it to the GetStore method when trying to one an isolated file storage (iso) store that requires that the identity of the assembly be provided.


System.Reflection.Assembly a = System.Reflection.Assembly.GetExecutingAssembly();
string assemblyPath = a.FullName;
System.Security.Policy.Url url = new System.Security.Policy.Url(assemblyPath);

No comments: