Re: "caspol -custom" yields "ERROR: Unable to create specified class."

From: Nicole Calinoiu (ngcalinoiu)
Date: 09/08/04


Date: Wed, 8 Sep 2004 14:43:14 -0400

Mark,

The class that it can't create is the StrongNameMembershipCondition. You
can only use the "-custom <file>" syntax if the default constructor for the
specified membership condition class has public accessibility. The default
constructor the StrongNameMembershipCondition is accessible only within the
mscorlib.dll assembly, so code in caspol.exe can't invoke it.

That said, you can use the "-strong" command line argument to obtain your
desired effect.

HTH,
Nicole

"MarkJJordan" <MarkJJordan@discussions.microsoft.com> wrote in message
news:BA23712B-648A-4DBB-ABBD-5AD5580A87FC@microsoft.com...
>I am experiencing an error message when attempting to add a code group via
> caspol.exe. The message is: "ERROR: Unable to create specified class.".
>
> My command line is as follows:
>
> caspol -enterprise -addgroup All_Code -custom
> c:\enterprise.codeGroup.MultiFileUpload.xml
>
> The XML file has the following contents that should add the new code group
> as a child to the All_Code group:
>
> === Contents of c:\enterprise.codeGroup.MultiFileUpload.xml ===
> <CodeGroup class="System.Security.Policy.UnionCodeGroup"
> version="1"
> PermissionSetName="mjj"
> Name="mjj"
> Description="mjj">
> <IMembershipCondition
> class="System.Security.Policy.StrongNameMembershipCondition"
> version="1"
> PublicKeyBlob="00000000000000000444000000000000"/>
> </CodeGroup>
> === End of Contents ===
>
> I should note that I first added this same code group via the .Net
> Configuration utility (mscorcfg.msc) with no problems. The code in the XML
> is
> a copy of what was in the enterprisesec.config file. Hence, I would expect
> the same exact code to work when used with caspol.exe.
>
> Any suggestions are welcome.
>
> Thanks in advance for any replies.
>
> Mark Jordan, MCSD
> Application Development Consultant
> Sagestone Consulting
> www.sagestone.com
> Grand Rapids, Michigan
> 616-954-9556, f: 616.954.7970
> Microsoft Gold Certified Partner
> mjordan@sagestone.com
>


Quantcast