Home All Groups Group Topic Archive Search About

Error from CAS Config util

Author
10 Mar 2005 3:28 AM
Trevor Lawrence
I am attempting to construct a custom implementation of IMembershipCondition
(which actually does a bit of work and then delegates to a
UrlMembershipCondition object).

I hjave given it a trong name and successfully installed it in the GAC, but
an attempt to add it to the policy assemblies in the config msc tool gives
an error that it couldn't add the assembly as it requires a strong name.
All checks indicate that it does have a proper strong name.  Is the tool
misleading?  Is this a generic message with one suggested cause?  The actual
message was:

"Unable to add the selected assembly.  The assembly must have a strong name
(name, version and public key)."

Any hints?

Trevor

--
=========================
Trevor Lawrence

TrevorL@@webone.com.au
=========================

Author
10 Mar 2005 11:56 AM
Nicole Calinoiu
Trevor,

It's a misleading error message.  The real problem is that the assembly
needs to be added to the trusted list at each of the enterprise, machine,
and user policy levels, and the UI only lets you target one of these at a
time.  To work around this limitation, you'll need to use caspol -af
(http://msdn.microsoft.com/library/en-us/cptools/html/cpgrfCodeAccessSecurityPolicyUtilityCaspolexe.asp).

HTH,
Nicole



Show quoteHide quote
"Trevor Lawrence" <trev***@webone.com.au> wrote in message
news:ep9OBFSJFHA.3596@TK2MSFTNGP14.phx.gbl...
>I am attempting to construct a custom implementation of
>IMembershipCondition (which actually does a bit of work and then delegates
>to a UrlMembershipCondition object).
>
> I hjave given it a trong name and successfully installed it in the GAC,
> but an attempt to add it to the policy assemblies in the config msc tool
> gives an error that it couldn't add the assembly as it requires a strong
> name. All checks indicate that it does have a proper strong name.  Is the
> tool misleading?  Is this a generic message with one suggested cause?  The
> actual message was:
>
> "Unable to add the selected assembly.  The assembly must have a strong
> name (name, version and public key)."
>
> Any hints?
>
> Trevor
>
> --
> =========================
> Trevor Lawrence
>
> TrevorL@@webone.com.au
> =========================
>
Are all your drivers up to date? click for free checkup

Author
10 Mar 2005 8:54 PM
Trevor Lawrence
I'll give it a try.

However, how come if that is the case I CAN add Microsoft.VisualBasic to the
trusted list at one level only?

Trevor

Show quoteHide quote
"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> wrote in message
news:Oiup4mWJFHA.3752@TK2MSFTNGP14.phx.gbl...
> Trevor,
>
> It's a misleading error message.  The real problem is that the assembly
> needs to be added to the trusted list at each of the enterprise, machine,
> and user policy levels, and the UI only lets you target one of these at a
> time.  To work around this limitation, you'll need to use caspol -af
> (http://msdn.microsoft.com/library/en-us/cptools/html/cpgrfCodeAccessSecurityPolicyUtilityCaspolexe.asp).
>
> HTH,
> Nicole
>
>
>
> "Trevor Lawrence" <trev***@webone.com.au> wrote in message
> news:ep9OBFSJFHA.3596@TK2MSFTNGP14.phx.gbl...
>>I am attempting to construct a custom implementation of
>>IMembershipCondition (which actually does a bit of work and then delegates
>>to a UrlMembershipCondition object).
>>
>> I hjave given it a trong name and successfully installed it in the GAC,
>> but an attempt to add it to the policy assemblies in the config msc tool
>> gives an error that it couldn't add the assembly as it requires a strong
>> name. All checks indicate that it does have a proper strong name.  Is the
>> tool misleading?  Is this a generic message with one suggested cause?
>> The actual message was:
>>
>> "Unable to add the selected assembly.  The assembly must have a strong
>> name (name, version and public key)."
>>
>> Any hints?
>>
>> Trevor
>>
>> --
>> =========================
>> Trevor Lawrence
>>
>> TrevorL@@webone.com.au
>> =========================
>>
>
>
Author
10 Mar 2005 9:31 PM
Nicole Calinoiu
Because I believed something I read without testing it properly. <g>  It
turns out the problem has nothing to do with the policy levels (and that
it's apparently quite possible to add to only one level).  Instead, it seems
to be related to the way caspol tries to load the target assembly.  You can
probably add Microsoft.VisualBasic via the UI since the assembly is located
in the same directory as caspol.  For assemblies in other directories, it
seems to be necessary to run caspol from an appropriate command line.

HTH,
Nicole


Show quoteHide quote
"Trevor Lawrence" <trev***@webone.com.au> wrote in message
news:%23ieNVNbJFHA.3196@TK2MSFTNGP15.phx.gbl...
> I'll give it a try.
>
> However, how come if that is the case I CAN add Microsoft.VisualBasic to
> the trusted list at one level only?
>
> Trevor
>
> "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> wrote in message
> news:Oiup4mWJFHA.3752@TK2MSFTNGP14.phx.gbl...
>> Trevor,
>>
>> It's a misleading error message.  The real problem is that the assembly
>> needs to be added to the trusted list at each of the enterprise, machine,
>> and user policy levels, and the UI only lets you target one of these at a
>> time.  To work around this limitation, you'll need to use caspol -af
>> (http://msdn.microsoft.com/library/en-us/cptools/html/cpgrfCodeAccessSecurityPolicyUtilityCaspolexe.asp).
>>
>> HTH,
>> Nicole
>>
>>
>>
>> "Trevor Lawrence" <trev***@webone.com.au> wrote in message
>> news:ep9OBFSJFHA.3596@TK2MSFTNGP14.phx.gbl...
>>>I am attempting to construct a custom implementation of
>>>IMembershipCondition (which actually does a bit of work and then
>>>delegates to a UrlMembershipCondition object).
>>>
>>> I hjave given it a trong name and successfully installed it in the GAC,
>>> but an attempt to add it to the policy assemblies in the config msc tool
>>> gives an error that it couldn't add the assembly as it requires a strong
>>> name. All checks indicate that it does have a proper strong name.  Is
>>> the tool misleading?  Is this a generic message with one suggested
>>> cause? The actual message was:
>>>
>>> "Unable to add the selected assembly.  The assembly must have a strong
>>> name (name, version and public key)."
>>>
>>> Any hints?
>>>
>>> Trevor
>>>
>>> --
>>> =========================
>>> Trevor Lawrence
>>>
>>> TrevorL@@webone.com.au
>>> =========================
>>>
>>
>>
>
>
Author
10 Mar 2005 11:09 PM
Trevor Lawrence
Sounds plausible.

You are right.  It works via CASPOL but not via the GUI.

Thanks

Trevor

Show quoteHide quote
"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> wrote in message
news:eukmUibJFHA.1044@TK2MSFTNGP12.phx.gbl...
> Because I believed something I read without testing it properly. <g>  It
> turns out the problem has nothing to do with the policy levels (and that
> it's apparently quite possible to add to only one level).  Instead, it
> seems to be related to the way caspol tries to load the target assembly.
> You can probably add Microsoft.VisualBasic via the UI since the assembly
> is located in the same directory as caspol.  For assemblies in other
> directories, it seems to be necessary to run caspol from an appropriate
> command line.
>
> HTH,
> Nicole
>
>
> "Trevor Lawrence" <trev***@webone.com.au> wrote in message
> news:%23ieNVNbJFHA.3196@TK2MSFTNGP15.phx.gbl...
>> I'll give it a try.
>>
>> However, how come if that is the case I CAN add Microsoft.VisualBasic to
>> the trusted list at one level only?
>>
>> Trevor
>>
>> "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> wrote in message
>> news:Oiup4mWJFHA.3752@TK2MSFTNGP14.phx.gbl...
>>> Trevor,
>>>
>>> It's a misleading error message.  The real problem is that the assembly
>>> needs to be added to the trusted list at each of the enterprise,
>>> machine, and user policy levels, and the UI only lets you target one of
>>> these at a time.  To work around this limitation, you'll need to use
>>> caspol -af
>>> (http://msdn.microsoft.com/library/en-us/cptools/html/cpgrfCodeAccessSecurityPolicyUtilityCaspolexe.asp).
>>>
>>> HTH,
>>> Nicole
>>>
>>>
>>>
>>> "Trevor Lawrence" <trev***@webone.com.au> wrote in message
>>> news:ep9OBFSJFHA.3596@TK2MSFTNGP14.phx.gbl...
>>>>I am attempting to construct a custom implementation of
>>>>IMembershipCondition (which actually does a bit of work and then
>>>>delegates to a UrlMembershipCondition object).
>>>>
>>>> I hjave given it a trong name and successfully installed it in the GAC,
>>>> but an attempt to add it to the policy assemblies in the config msc
>>>> tool gives an error that it couldn't add the assembly as it requires a
>>>> strong name. All checks indicate that it does have a proper strong
>>>> name.  Is the tool misleading?  Is this a generic message with one
>>>> suggested cause? The actual message was:
>>>>
>>>> "Unable to add the selected assembly.  The assembly must have a strong
>>>> name (name, version and public key)."
>>>>
>>>> Any hints?
>>>>
>>>> Trevor
>>>>
>>>> --
>>>> =========================
>>>> Trevor Lawrence
>>>>
>>>> TrevorL@@webone.com.au
>>>> =========================
>>>>
>>>
>>>
>>
>>
>
>
Author
11 Mar 2005 3:53 AM
Trevor Lawrence
I move forward.

I'm now using GacUtil and CasPol from a small batch file to load stuff up
and create a code group with a custom membership condition.  There must be
something I am missing in the process because whatever I do when it gets to
creating the code group with a ustom membership condition, CasPol gives an
error

ERROR: Unable to create specified class.

I have replicated the process using the custom membership condition in the
Office 11 Addins
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_wrcore/html/wrtskcreatingcustomcodegroupfordocumentsworkbooks.asp)
and that membership class works fine, so it is not my procedures.  I've even
had a good look with ILdasm at that office class.  It's pretty simple and
doesn't seem to do anything mine doesn't do.  My class doesn't reference
anything except mscorlib and Microsoft.VisualBasic and both those assemblies
are in the FullTrust list.

I must have left out something obvious.  Any guesses?

Trevor

Show quoteHide quote
"Trevor Lawrence" <trev***@webone.com.au> wrote in message
news:eg$2AZcJFHA.2476@TK2MSFTNGP12.phx.gbl...
> Sounds plausible.
>
> You are right.  It works via CASPOL but not via the GUI.
>
> Thanks
>
> Trevor
>
> "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> wrote in message
> news:eukmUibJFHA.1044@TK2MSFTNGP12.phx.gbl...
>> Because I believed something I read without testing it properly. <g>  It
>> turns out the problem has nothing to do with the policy levels (and that
>> it's apparently quite possible to add to only one level).  Instead, it
>> seems to be related to the way caspol tries to load the target assembly.
>> You can probably add Microsoft.VisualBasic via the UI since the assembly
>> is located in the same directory as caspol.  For assemblies in other
>> directories, it seems to be necessary to run caspol from an appropriate
>> command line.
>>
>> HTH,
>> Nicole
>>
>>
>> "Trevor Lawrence" <trev***@webone.com.au> wrote in message
>> news:%23ieNVNbJFHA.3196@TK2MSFTNGP15.phx.gbl...
>>> I'll give it a try.
>>>
>>> However, how come if that is the case I CAN add Microsoft.VisualBasic to
>>> the trusted list at one level only?
>>>
>>> Trevor
>>>
>>> "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> wrote in
>>> message news:Oiup4mWJFHA.3752@TK2MSFTNGP14.phx.gbl...
>>>> Trevor,
>>>>
>>>> It's a misleading error message.  The real problem is that the assembly
>>>> needs to be added to the trusted list at each of the enterprise,
>>>> machine, and user policy levels, and the UI only lets you target one of
>>>> these at a time.  To work around this limitation, you'll need to use
>>>> caspol -af
>>>> (http://msdn.microsoft.com/library/en-us/cptools/html/cpgrfCodeAccessSecurityPolicyUtilityCaspolexe.asp).
>>>>
>>>> HTH,
>>>> Nicole
>>>>
>>>>
>>>>
>>>> "Trevor Lawrence" <trev***@webone.com.au> wrote in message
>>>> news:ep9OBFSJFHA.3596@TK2MSFTNGP14.phx.gbl...
>>>>>I am attempting to construct a custom implementation of
>>>>>IMembershipCondition (which actually does a bit of work and then
>>>>>delegates to a UrlMembershipCondition object).
>>>>>
>>>>> I hjave given it a trong name and successfully installed it in the
>>>>> GAC, but an attempt to add it to the policy assemblies in the config
>>>>> msc tool gives an error that it couldn't add the assembly as it
>>>>> requires a strong name. All checks indicate that it does have a proper
>>>>> strong name.  Is the tool misleading?  Is this a generic message with
>>>>> one suggested cause? The actual message was:
>>>>>
>>>>> "Unable to add the selected assembly.  The assembly must have a strong
>>>>> name (name, version and public key)."
>>>>>
>>>>> Any hints?
>>>>>
>>>>> Trevor
>>>>>
>>>>> --
>>>>> =========================
>>>>> Trevor Lawrence
>>>>>
>>>>> TrevorL@@webone.com.au
>>>>> =========================
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
Author
11 Mar 2005 12:19 PM
Nicole Calinoiu
I've only been able to get caspol -af to work for assemblies outside the
..NET Framework folder when the target assembly's folder is the current
directory for caspol.  In a batch file, you might use something like this to
register D:\SomeDir\SomeLibrary.dll as a policy assembly:

cd /d D:\SomeDir
gacutil -i SomeLibrary.dll
caspol -af SomeLibrary.dll

HTH,
Nicole



Show quoteHide quote
"Trevor Lawrence" <trev***@webone.com.au> wrote in message
news:OAVR03eJFHA.732@TK2MSFTNGP12.phx.gbl...
>I move forward.
>
> I'm now using GacUtil and CasPol from a small batch file to load stuff up
> and create a code group with a custom membership condition.  There must be
> something I am missing in the process because whatever I do when it gets
> to creating the code group with a ustom membership condition, CasPol gives
> an error
>
> ERROR: Unable to create specified class.
>
> I have replicated the process using the custom membership condition in the
> Office 11 Addins
> (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_wrcore/html/wrtskcreatingcustomcodegroupfordocumentsworkbooks.asp)
> and that membership class works fine, so it is not my procedures.  I've
> even had a good look with ILdasm at that office class.  It's pretty simple
> and doesn't seem to do anything mine doesn't do.  My class doesn't
> reference anything except mscorlib and Microsoft.VisualBasic and both
> those assemblies are in the FullTrust list.
>
> I must have left out something obvious.  Any guesses?
>
> Trevor
>
> "Trevor Lawrence" <trev***@webone.com.au> wrote in message
> news:eg$2AZcJFHA.2476@TK2MSFTNGP12.phx.gbl...
>> Sounds plausible.
>>
>> You are right.  It works via CASPOL but not via the GUI.
>>
>> Thanks
>>
>> Trevor
>>
>> "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> wrote in message
>> news:eukmUibJFHA.1044@TK2MSFTNGP12.phx.gbl...
>>> Because I believed something I read without testing it properly. <g>  It
>>> turns out the problem has nothing to do with the policy levels (and that
>>> it's apparently quite possible to add to only one level).  Instead, it
>>> seems to be related to the way caspol tries to load the target assembly.
>>> You can probably add Microsoft.VisualBasic via the UI since the assembly
>>> is located in the same directory as caspol.  For assemblies in other
>>> directories, it seems to be necessary to run caspol from an appropriate
>>> command line.
>>>
>>> HTH,
>>> Nicole
>>>
>>>
>>> "Trevor Lawrence" <trev***@webone.com.au> wrote in message
>>> news:%23ieNVNbJFHA.3196@TK2MSFTNGP15.phx.gbl...
>>>> I'll give it a try.
>>>>
>>>> However, how come if that is the case I CAN add Microsoft.VisualBasic
>>>> to the trusted list at one level only?
>>>>
>>>> Trevor
>>>>
>>>> "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> wrote in
>>>> message news:Oiup4mWJFHA.3752@TK2MSFTNGP14.phx.gbl...
>>>>> Trevor,
>>>>>
>>>>> It's a misleading error message.  The real problem is that the
>>>>> assembly needs to be added to the trusted list at each of the
>>>>> enterprise, machine, and user policy levels, and the UI only lets you
>>>>> target one of these at a time.  To work around this limitation, you'll
>>>>> need to use caspol -af
>>>>> (http://msdn.microsoft.com/library/en-us/cptools/html/cpgrfCodeAccessSecurityPolicyUtilityCaspolexe.asp).
>>>>>
>>>>> HTH,
>>>>> Nicole
>>>>>
>>>>>
>>>>>
>>>>> "Trevor Lawrence" <trev***@webone.com.au> wrote in message
>>>>> news:ep9OBFSJFHA.3596@TK2MSFTNGP14.phx.gbl...
>>>>>>I am attempting to construct a custom implementation of
>>>>>>IMembershipCondition (which actually does a bit of work and then
>>>>>>delegates to a UrlMembershipCondition object).
>>>>>>
>>>>>> I hjave given it a trong name and successfully installed it in the
>>>>>> GAC, but an attempt to add it to the policy assemblies in the config
>>>>>> msc tool gives an error that it couldn't add the assembly as it
>>>>>> requires a strong name. All checks indicate that it does have a
>>>>>> proper strong name.  Is the tool misleading?  Is this a generic
>>>>>> message with one suggested cause? The actual message was:
>>>>>>
>>>>>> "Unable to add the selected assembly.  The assembly must have a
>>>>>> strong name (name, version and public key)."
>>>>>>
>>>>>> Any hints?
>>>>>>
>>>>>> Trevor
>>>>>>
>>>>>> --
>>>>>> =========================
>>>>>> Trevor Lawrence
>>>>>>
>>>>>> TrevorL@@webone.com.au
>>>>>> =========================
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
Author
11 Mar 2005 12:36 PM
Nicole Calinoiu
And you might want to use the -q option for caspol too if you're running
from a batch file...

Show quoteHide quote
"Trevor Lawrence" <trev***@webone.com.au> wrote in message
news:OAVR03eJFHA.732@TK2MSFTNGP12.phx.gbl...
>I move forward.
>
> I'm now using GacUtil and CasPol from a small batch file to load stuff up
> and create a code group with a custom membership condition.  There must be
> something I am missing in the process because whatever I do when it gets
> to creating the code group with a ustom membership condition, CasPol gives
> an error
>
> ERROR: Unable to create specified class.
>
> I have replicated the process using the custom membership condition in the
> Office 11 Addins
> (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_wrcore/html/wrtskcreatingcustomcodegroupfordocumentsworkbooks.asp)
> and that membership class works fine, so it is not my procedures.  I've
> even had a good look with ILdasm at that office class.  It's pretty simple
> and doesn't seem to do anything mine doesn't do.  My class doesn't
> reference anything except mscorlib and Microsoft.VisualBasic and both
> those assemblies are in the FullTrust list.
>
> I must have left out something obvious.  Any guesses?
>
> Trevor
>
> "Trevor Lawrence" <trev***@webone.com.au> wrote in message
> news:eg$2AZcJFHA.2476@TK2MSFTNGP12.phx.gbl...
>> Sounds plausible.
>>
>> You are right.  It works via CASPOL but not via the GUI.
>>
>> Thanks
>>
>> Trevor
>>
>> "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> wrote in message
>> news:eukmUibJFHA.1044@TK2MSFTNGP12.phx.gbl...
>>> Because I believed something I read without testing it properly. <g>  It
>>> turns out the problem has nothing to do with the policy levels (and that
>>> it's apparently quite possible to add to only one level).  Instead, it
>>> seems to be related to the way caspol tries to load the target assembly.
>>> You can probably add Microsoft.VisualBasic via the UI since the assembly
>>> is located in the same directory as caspol.  For assemblies in other
>>> directories, it seems to be necessary to run caspol from an appropriate
>>> command line.
>>>
>>> HTH,
>>> Nicole
>>>
>>>
>>> "Trevor Lawrence" <trev***@webone.com.au> wrote in message
>>> news:%23ieNVNbJFHA.3196@TK2MSFTNGP15.phx.gbl...
>>>> I'll give it a try.
>>>>
>>>> However, how come if that is the case I CAN add Microsoft.VisualBasic
>>>> to the trusted list at one level only?
>>>>
>>>> Trevor
>>>>
>>>> "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> wrote in
>>>> message news:Oiup4mWJFHA.3752@TK2MSFTNGP14.phx.gbl...
>>>>> Trevor,
>>>>>
>>>>> It's a misleading error message.  The real problem is that the
>>>>> assembly needs to be added to the trusted list at each of the
>>>>> enterprise, machine, and user policy levels, and the UI only lets you
>>>>> target one of these at a time.  To work around this limitation, you'll
>>>>> need to use caspol -af
>>>>> (http://msdn.microsoft.com/library/en-us/cptools/html/cpgrfCodeAccessSecurityPolicyUtilityCaspolexe.asp).
>>>>>
>>>>> HTH,
>>>>> Nicole
>>>>>
>>>>>
>>>>>
>>>>> "Trevor Lawrence" <trev***@webone.com.au> wrote in message
>>>>> news:ep9OBFSJFHA.3596@TK2MSFTNGP14.phx.gbl...
>>>>>>I am attempting to construct a custom implementation of
>>>>>>IMembershipCondition (which actually does a bit of work and then
>>>>>>delegates to a UrlMembershipCondition object).
>>>>>>
>>>>>> I hjave given it a trong name and successfully installed it in the
>>>>>> GAC, but an attempt to add it to the policy assemblies in the config
>>>>>> msc tool gives an error that it couldn't add the assembly as it
>>>>>> requires a strong name. All checks indicate that it does have a
>>>>>> proper strong name.  Is the tool misleading?  Is this a generic
>>>>>> message with one suggested cause? The actual message was:
>>>>>>
>>>>>> "Unable to add the selected assembly.  The assembly must have a
>>>>>> strong name (name, version and public key)."
>>>>>>
>>>>>> Any hints?
>>>>>>
>>>>>> Trevor
>>>>>>
>>>>>> --
>>>>>> =========================
>>>>>> Trevor Lawrence
>>>>>>
>>>>>> TrevorL@@webone.com.au
>>>>>> =========================
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
Author
11 Mar 2005 9:39 PM
Trevor Lawrence
Problem sorted.  There was a problem with the way that the implementation of
the three required interfaces was set up in the VB code with the conflicting
names in a couple of the interfaces.  I built a different version (more
carefully) in C# and the problem went away and the Membership condition
installed properly.  I'm sure I could have straightened up the VB version as
well, its just that I decided to give a C# version a go.

By the way caspol is working fine picking up assemblies from arbitrary
directories.

Trevor

Show quoteHide quote
"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> wrote in message
news:OKeBbjjJFHA.2752@TK2MSFTNGP10.phx.gbl...
> And you might want to use the -q option for caspol too if you're running
> from a batch file...
>
> "Trevor Lawrence" <trev***@webone.com.au> wrote in message
> news:OAVR03eJFHA.732@TK2MSFTNGP12.phx.gbl...
>>I move forward.
>>
>> I'm now using GacUtil and CasPol from a small batch file to load stuff up
>> and create a code group with a custom membership condition.  There must
>> be something I am missing in the process because whatever I do when it
>> gets to creating the code group with a ustom membership condition, CasPol
>> gives an error
>>
>> ERROR: Unable to create specified class.
>>
>> I have replicated the process using the custom membership condition in
>> the Office 11 Addins
>> (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_wrcore/html/wrtskcreatingcustomcodegroupfordocumentsworkbooks.asp)
>> and that membership class works fine, so it is not my procedures.  I've
>> even had a good look with ILdasm at that office class.  It's pretty
>> simple and doesn't seem to do anything mine doesn't do.  My class doesn't
>> reference anything except mscorlib and Microsoft.VisualBasic and both
>> those assemblies are in the FullTrust list.
>>
>> I must have left out something obvious.  Any guesses?
>>
>> Trevor
>>
>> "Trevor Lawrence" <trev***@webone.com.au> wrote in message
>> news:eg$2AZcJFHA.2476@TK2MSFTNGP12.phx.gbl...
>>> Sounds plausible.
>>>
>>> You are right.  It works via CASPOL but not via the GUI.
>>>
>>> Thanks
>>>
>>> Trevor
>>>
>>> "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> wrote in
>>> message news:eukmUibJFHA.1044@TK2MSFTNGP12.phx.gbl...
>>>> Because I believed something I read without testing it properly. <g>
>>>> It turns out the problem has nothing to do with the policy levels (and
>>>> that it's apparently quite possible to add to only one level).
>>>> Instead, it seems to be related to the way caspol tries to load the
>>>> target assembly. You can probably add Microsoft.VisualBasic via the UI
>>>> since the assembly is located in the same directory as caspol.  For
>>>> assemblies in other directories, it seems to be necessary to run caspol
>>>> from an appropriate command line.
>>>>
>>>> HTH,
>>>> Nicole
>>>>
>>>>
>>>> "Trevor Lawrence" <trev***@webone.com.au> wrote in message
>>>> news:%23ieNVNbJFHA.3196@TK2MSFTNGP15.phx.gbl...
>>>>> I'll give it a try.
>>>>>
>>>>> However, how come if that is the case I CAN add Microsoft.VisualBasic
>>>>> to the trusted list at one level only?
>>>>>
>>>>> Trevor
>>>>>
>>>>> "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> wrote in
>>>>> message news:Oiup4mWJFHA.3752@TK2MSFTNGP14.phx.gbl...
>>>>>> Trevor,
>>>>>>
>>>>>> It's a misleading error message.  The real problem is that the
>>>>>> assembly needs to be added to the trusted list at each of the
>>>>>> enterprise, machine, and user policy levels, and the UI only lets you
>>>>>> target one of these at a time.  To work around this limitation,
>>>>>> you'll need to use caspol -af
>>>>>> (http://msdn.microsoft.com/library/en-us/cptools/html/cpgrfCodeAccessSecurityPolicyUtilityCaspolexe.asp).
>>>>>>
>>>>>> HTH,
>>>>>> Nicole
>>>>>>
>>>>>>
>>>>>>
>>>>>> "Trevor Lawrence" <trev***@webone.com.au> wrote in message
>>>>>> news:ep9OBFSJFHA.3596@TK2MSFTNGP14.phx.gbl...
>>>>>>>I am attempting to construct a custom implementation of
>>>>>>>IMembershipCondition (which actually does a bit of work and then
>>>>>>>delegates to a UrlMembershipCondition object).
>>>>>>>
>>>>>>> I hjave given it a trong name and successfully installed it in the
>>>>>>> GAC, but an attempt to add it to the policy assemblies in the config
>>>>>>> msc tool gives an error that it couldn't add the assembly as it
>>>>>>> requires a strong name. All checks indicate that it does have a
>>>>>>> proper strong name.  Is the tool misleading?  Is this a generic
>>>>>>> message with one suggested cause? The actual message was:
>>>>>>>
>>>>>>> "Unable to add the selected assembly.  The assembly must have a
>>>>>>> strong name (name, version and public key)."
>>>>>>>
>>>>>>> Any hints?
>>>>>>>
>>>>>>> Trevor
>>>>>>>
>>>>>>> --
>>>>>>> =========================
>>>>>>> Trevor Lawrence
>>>>>>>
>>>>>>> TrevorL@@webone.com.au
>>>>>>> =========================
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>

Bookmark and Share