Home All Groups Group Topic Archive Search About

Request for permission of the type 'System.Security.Permissions.RegistryPermission...' failed

Author
11 Apr 2006 7:06 PM
Bryan Dickerson
The full message is:

Request for permission of the type
'System.Security.Permissions.RegistryPermission, mscorlib, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

It happened while trying to execute a small program, from a network share,
that will tests the correct installation of some ODBC/OLE drivers.  It opens
a specific registry key with My.Computer.Registry.LocalMachine and then does
a quick SQL query via OLE drivers against a table in the company database.
I copied all three items in the \bin directory of the project to the network
share expecting that it would need all of them to run.  So what is the error
message telling me??

TIA!

--
TFWBWY...A

Author
18 Apr 2006 3:36 PM
Bryan Dickerson
I forgot to add that I'm using VS 2005, but perhaps that's evident from the
"My." object.  Does anyone have any ideas??

Show quoteHide quote
"Bryan Dickerson" <txprp***@netscape.net> wrote in message
news:OfYjAsZXGHA.508@TK2MSFTNGP02.phx.gbl...
> The full message is:
>
> Request for permission of the type
> 'System.Security.Permissions.RegistryPermission, mscorlib,
> Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
>
> It happened while trying to execute a small program, from a network share,
> that will tests the correct installation of some ODBC/OLE drivers.  It
> opens a specific registry key with My.Computer.Registry.LocalMachine and
> then does a quick SQL query via OLE drivers against a table in the company
> database. I copied all three items in the \bin directory of the project to
> the network share expecting that it would need all of them to run.  So
> what is the error message telling me??
>
> TIA!
>
> --
> TFWBWY...A
>
Author
18 Apr 2006 3:54 PM
VJ
You can't do that.. When a assembly runs of the network, its not in
full-trusted mode, like running locally. Also, you don't have registry
access when running from a limited user XP Account.

Vijay

Show quoteHide quote
"Bryan Dickerson" <txprp***@netscape.net> wrote in message
news:%234f$r3vYGHA.3516@TK2MSFTNGP03.phx.gbl...
>I forgot to add that I'm using VS 2005, but perhaps that's evident from the
>"My." object.  Does anyone have any ideas??
>
> "Bryan Dickerson" <txprp***@netscape.net> wrote in message
> news:OfYjAsZXGHA.508@TK2MSFTNGP02.phx.gbl...
>> The full message is:
>>
>> Request for permission of the type
>> 'System.Security.Permissions.RegistryPermission, mscorlib,
>> Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
>> failed.
>>
>> It happened while trying to execute a small program, from a network
>> share, that will tests the correct installation of some ODBC/OLE drivers.
>> It opens a specific registry key with My.Computer.Registry.LocalMachine
>> and then does a quick SQL query via OLE drivers against a table in the
>> company database. I copied all three items in the \bin directory of the
>> project to the network share expecting that it would need all of them to
>> run.  So what is the error message telling me??
>>
>> TIA!
>>
>> --
>> TFWBWY...A
>>
>
>
Author
18 Apr 2006 4:01 PM
Bryan Dickerson
So, do I just need to go back to using the Windows Shell API to read the
registry (seems a pity)?  Or how do I attain "full-trusted mode" from a
Network share?

Show quoteHide quote
"VJ" <vijayba***@yahoo.com> wrote in message
news:O4MuwBwYGHA.3972@TK2MSFTNGP04.phx.gbl...
> You can't do that.. When a assembly runs of the network, its not in
> full-trusted mode, like running locally. Also, you don't have registry
> access when running from a limited user XP Account.
>
> Vijay
>
> "Bryan Dickerson" <txprp***@netscape.net> wrote in message
> news:%234f$r3vYGHA.3516@TK2MSFTNGP03.phx.gbl...
>>I forgot to add that I'm using VS 2005, but perhaps that's evident from
>>the "My." object.  Does anyone have any ideas??
>>
>> "Bryan Dickerson" <txprp***@netscape.net> wrote in message
>> news:OfYjAsZXGHA.508@TK2MSFTNGP02.phx.gbl...
>>> The full message is:
>>>
>>> Request for permission of the type
>>> 'System.Security.Permissions.RegistryPermission, mscorlib,
>>> Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
>>> failed.
>>>
>>> It happened while trying to execute a small program, from a network
>>> share, that will tests the correct installation of some ODBC/OLE
>>> drivers. It opens a specific registry key with
>>> My.Computer.Registry.LocalMachine and then does a quick SQL query via
>>> OLE drivers against a table in the company database. I copied all three
>>> items in the \bin directory of the project to the network share
>>> expecting that it would need all of them to run.  So what is the error
>>> message telling me??
>>>
>>> TIA!
>>>
>>> --
>>> TFWBWY...A
>>>
>>
>>
>
>
Author
18 Apr 2006 5:01 PM
VJ
I am not really sure, I just have knowledge, have not implemented any
code.... But I believe you have to use some class from System.Security
namespace. for it... Check http://www.codeproject.com. You might find some
samples there.. or try Google it...  or using Shell API is the other
option..., even so I am not sure you can get a trusted access from within a
..NET assembly...

I assume that you are keeping some settings for your application, try
keeping them in local file that goes along with the APP, but if you are
reading the registry for ODBC settings, then I don't know of a better way to
do that. You can check any of the above resources mentioned above

Vijay

Show quoteHide quote
"Bryan Dickerson" <txprp***@netscape.net> wrote in message
news:OReBUFwYGHA.1196@TK2MSFTNGP03.phx.gbl...
> So, do I just need to go back to using the Windows Shell API to read the
> registry (seems a pity)?  Or how do I attain "full-trusted mode" from a
> Network share?
>
> "VJ" <vijayba***@yahoo.com> wrote in message
> news:O4MuwBwYGHA.3972@TK2MSFTNGP04.phx.gbl...
>> You can't do that.. When a assembly runs of the network, its not in
>> full-trusted mode, like running locally. Also, you don't have registry
>> access when running from a limited user XP Account.
>>
>> Vijay
>>
>> "Bryan Dickerson" <txprp***@netscape.net> wrote in message
>> news:%234f$r3vYGHA.3516@TK2MSFTNGP03.phx.gbl...
>>>I forgot to add that I'm using VS 2005, but perhaps that's evident from
>>>the "My." object.  Does anyone have any ideas??
>>>
>>> "Bryan Dickerson" <txprp***@netscape.net> wrote in message
>>> news:OfYjAsZXGHA.508@TK2MSFTNGP02.phx.gbl...
>>>> The full message is:
>>>>
>>>> Request for permission of the type
>>>> 'System.Security.Permissions.RegistryPermission, mscorlib,
>>>> Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
>>>> failed.
>>>>
>>>> It happened while trying to execute a small program, from a network
>>>> share, that will tests the correct installation of some ODBC/OLE
>>>> drivers. It opens a specific registry key with
>>>> My.Computer.Registry.LocalMachine and then does a quick SQL query via
>>>> OLE drivers against a table in the company database. I copied all three
>>>> items in the \bin directory of the project to the network share
>>>> expecting that it would need all of them to run.  So what is the error
>>>> message telling me??
>>>>
>>>> TIA!
>>>>
>>>> --
>>>> TFWBWY...A
>>>>
>>>
>>>
>>
>>
>
>
Author
18 Apr 2006 6:38 PM
Bryan Dickerson
Anyone else got any ideas?

Show quoteHide quote
"VJ" <vijayba***@yahoo.com> wrote in message
news:ekaEOnwYGHA.3444@TK2MSFTNGP05.phx.gbl...
>I am not really sure, I just have knowledge, have not implemented any
>code.... But I believe you have to use some class from System.Security
>namespace. for it... Check http://www.codeproject.com. You might find some
>samples there.. or try Google it...  or using Shell API is the other
>option..., even so I am not sure you can get a trusted access from within a
>.NET assembly...
>
> I assume that you are keeping some settings for your application, try
> keeping them in local file that goes along with the APP, but if you are
> reading the registry for ODBC settings, then I don't know of a better way
> to do that. You can check any of the above resources mentioned above
>
> Vijay
>
> "Bryan Dickerson" <txprp***@netscape.net> wrote in message
> news:OReBUFwYGHA.1196@TK2MSFTNGP03.phx.gbl...
>> So, do I just need to go back to using the Windows Shell API to read the
>> registry (seems a pity)?  Or how do I attain "full-trusted mode" from a
>> Network share?
>>
>> "VJ" <vijayba***@yahoo.com> wrote in message
>> news:O4MuwBwYGHA.3972@TK2MSFTNGP04.phx.gbl...
>>> You can't do that.. When a assembly runs of the network, its not in
>>> full-trusted mode, like running locally. Also, you don't have registry
>>> access when running from a limited user XP Account.
>>>
>>> Vijay
>>>
>>> "Bryan Dickerson" <txprp***@netscape.net> wrote in message
>>> news:%234f$r3vYGHA.3516@TK2MSFTNGP03.phx.gbl...
>>>>I forgot to add that I'm using VS 2005, but perhaps that's evident from
>>>>the "My." object.  Does anyone have any ideas??
>>>>
>>>> "Bryan Dickerson" <txprp***@netscape.net> wrote in message
>>>> news:OfYjAsZXGHA.508@TK2MSFTNGP02.phx.gbl...
>>>>> The full message is:
>>>>>
>>>>> Request for permission of the type
>>>>> 'System.Security.Permissions.RegistryPermission, mscorlib,
>>>>> Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
>>>>> failed.
>>>>>
>>>>> It happened while trying to execute a small program, from a network
>>>>> share, that will tests the correct installation of some ODBC/OLE
>>>>> drivers. It opens a specific registry key with
>>>>> My.Computer.Registry.LocalMachine and then does a quick SQL query via
>>>>> OLE drivers against a table in the company database. I copied all
>>>>> three items in the \bin directory of the project to the network share
>>>>> expecting that it would need all of them to run.  So what is the error
>>>>> message telling me??
>>>>>
>>>>> TIA!
>>>>>
>>>>> --
>>>>> TFWBWY...A
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
Author
19 Apr 2006 10:00 AM
Phill W.
Look into Code Access Security Policies (CASPOL).

You can set up areas of your network from which you "trust" .Net code as
though it were on your local machine and, therefore, with all the
permissions you require.

IIRC, VS2005 has some Whizzo tools for working out exactly what
permissions your application(s) require but, where I am, just picking a
known network location and granting "Full Trust" to it works quite nicely.

HTH,
     Phill  W.

Bryan Dickerson wrote:
Show quoteHide quote
> So, do I just need to go back to using the Windows Shell API to read the
> registry (seems a pity)?  Or how do I attain "full-trusted mode" from a
> Network share?
>
> "VJ" <vijayba***@yahoo.com> wrote in message
> news:O4MuwBwYGHA.3972@TK2MSFTNGP04.phx.gbl...
>> You can't do that.. When a assembly runs of the network, its not in
>> full-trusted mode, like running locally. Also, you don't have registry
>> access when running from a limited user XP Account.
>>
>> Vijay
>>
>> "Bryan Dickerson" <txprp***@netscape.net> wrote in message
>> news:%234f$r3vYGHA.3516@TK2MSFTNGP03.phx.gbl...
>>> I forgot to add that I'm using VS 2005, but perhaps that's evident from
>>> the "My." object.  Does anyone have any ideas??
Author
24 Apr 2006 8:41 PM
Bryan Dickerson
Thanks for your response.  So would I have to setup the security on every
machine that runs it?  At least for the first time it's invoked?

Show quoteHide quote
"Phill W." <p-.-a-.-w-a-r-d@o-p-e-n-.-a-c-.-u-k> wrote in message
news:e251kl$t34$1@yarrow.open.ac.uk...
>
> Look into Code Access Security Policies (CASPOL).
>
> You can set up areas of your network from which you "trust" .Net code as
> though it were on your local machine and, therefore, with all the
> permissions you require.
>
> IIRC, VS2005 has some Whizzo tools for working out exactly what
> permissions your application(s) require but, where I am, just picking a
> known network location and granting "Full Trust" to it works quite nicely.
>
> HTH,
>     Phill  W.
>
> Bryan Dickerson wrote:
>> So, do I just need to go back to using the Windows Shell API to read the
>> registry (seems a pity)?  Or how do I attain "full-trusted mode" from a
>> Network share?
>>
>> "VJ" <vijayba***@yahoo.com> wrote in message
>> news:O4MuwBwYGHA.3972@TK2MSFTNGP04.phx.gbl...
>>> You can't do that.. When a assembly runs of the network, its not in
>>> full-trusted mode, like running locally. Also, you don't have registry
>>> access when running from a limited user XP Account.
>>>
>>> Vijay
>>>
>>> "Bryan Dickerson" <txprp***@netscape.net> wrote in message
>>> news:%234f$r3vYGHA.3516@TK2MSFTNGP03.phx.gbl...
>>>> I forgot to add that I'm using VS 2005, but perhaps that's evident from
>>>> the "My." object.  Does anyone have any ideas??
Author
25 Apr 2006 11:16 AM
Phill W.
That's my understanding of it, yes.  :-(

Regards,
    Phill  W.

Bryan Dickerson wrote:
Show quoteHide quote
> Thanks for your response.  So would I have to setup the security on every
> machine that runs it?  At least for the first time it's invoked?
>
> "Phill W." <p-.-a-.-w-a-r-d@o-p-e-n-.-a-c-.-u-k> wrote in message
> news:e251kl$t34$1@yarrow.open.ac.uk...
>> Look into Code Access Security Policies (CASPOL).
>>
>> You can set up areas of your network from which you "trust" .Net code as
>> though it were on your local machine and, therefore, with all the
>> permissions you require.
>>
>> IIRC, VS2005 has some Whizzo tools for working out exactly what
>> permissions your application(s) require but, where I am, just picking a
>> known network location and granting "Full Trust" to it works quite nicely.
>>
>> HTH,
>>     Phill  W.
>>
>> Bryan Dickerson wrote:
>>> So, do I just need to go back to using the Windows Shell API to read the
>>> registry (seems a pity)?  Or how do I attain "full-trusted mode" from a
>>> Network share?
>>>
>>> "VJ" <vijayba***@yahoo.com> wrote in message
>>> news:O4MuwBwYGHA.3972@TK2MSFTNGP04.phx.gbl...
>>>> You can't do that.. When a assembly runs of the network, its not in
>>>> full-trusted mode, like running locally. Also, you don't have registry
>>>> access when running from a limited user XP Account.
>>>>
>>>> Vijay
>>>>
>>>> "Bryan Dickerson" <txprp***@netscape.net> wrote in message
>>>> news:%234f$r3vYGHA.3516@TK2MSFTNGP03.phx.gbl...
>>>>> I forgot to add that I'm using VS 2005, but perhaps that's evident from
>>>>> the "My." object.  Does anyone have any ideas??
>
>