Re: Required permissions cannot be acquired?

From: Bradley Plett (plettb_at_hotmail.com)
Date: 09/23/04


Date: Thu, 23 Sep 2004 13:47:27 -0600

Sorry - I was away from this problem for a while, but I'd still like
to solve it.

In answer to your question, I have a Visual Studio project to build
the assembly. I don't understand where you're going with this, but
the only reference to the Oracle.DataAccess.dll in my vbproj file is
as follows:
--------------------------------------------------
  <Reference
    Name = "Oracle.DataAccess"
    AssemblyName = "Oracle.DataAccess"
    HintPath = "..\..\oracle\ora92\bin\Oracle.DataAccess.dll"
    AssemblyFolderKey = "hklm\dn\odp.net"
  />
--------------------------------------------------

As I mentioned in a previous post, I'm guessing I'm referencing it as
a private assembly, whereas I should reference it through the GAC.
I'd gladly reference it through the GAC, but how?

Thanks!
Brad.

On Fri, 3 Sep 2004 16:11:32 -0400, "Nicole Calinoiu" <ngcalinoiu
REMOVETHIS AT gmail DOT com> wrote:

>Did you create a Visual Studio project to build an assembly that is
>performing the authentication against the Oracle database? If so, that's
>where the reference was set to Oracle.DataAccess.dll, not in the
>rssrvpolicy.config file. If not, could you please identify the sample you
>are following since there are just too many possibilities for me to keep
>guessing...
>
>
>"Bradley Plett" <plettb@hotmail.com> wrote in message
>news:ob8hj0d7u5elmda60ipnbiu8flel9q3vmv@4ax.com...
>>I think you may have identified the problem, but my knowledge of
>> security policy configuration files is too limited to solve it. :-(
>>
>> Looking at the config file, I'm guessing I'm referencing it as a
>> private assembly, whereas I should reference it through the GAC. I'd
>> gladly reference it through the GAC, but how?
>>
>> Here's the relevant snippet of code from the rssrvpolicy.config file:
>> ==================================================
>> <CodeGroup
>> class="UnionCodeGroup"
>> version="1"
>> Name="OracleDataAccess"
>> Description="Code group for Oracle data access"
>> PermissionSetName="FullTrust">
>> <IMembershipCondition
>> class="UrlMembershipCondition"
>> version="1"
>> Url="C:\oracle\ora92\bin\Oracle.DataAccess.dll"
>> />
>> </CodeGroup>
>> ==================================================
>> I added this code using another sample, but the sample uses a private
>> assembly. How would I change this to use the copy or Oracle that is
>> registered in the GAC? (I realize there may be tokens in the above
>> snippet that you'll need in order to help me. If so, please let me
>> know - the entire file was a little too big to post.)
>>
>> Thanks again!
>> Brad.
>>
>>
>> On Fri, 3 Sep 2004 12:12:32 -0400, "Nicole Calinoiu" <ngcalinoiu
>> REMOVETHIS AT gmail DOT com> wrote:
>>
>>>Whoops, forgot a question... Is your code referencing
>>>Oracle.DataAccess.dll
>>>from the GAC or as a private assembly copied into its own location? If
>>>the
>>>latter, it probably won't be granted the SkipVerification permission it
>>>requires, thereby explaining the PolicyException. If this is the problem,
>>>referencing it from the GAC should fix it.
>>>
>>>
>>>
>>>"Bradley Plett" <plettb@hotmail.com> wrote in message
>>>news:vn2hj0hd8bv8dp316ddc71s6fpirutgpig@4ax.com...
>>>> Thanks a lot - this may be getting me closer! :-)
>>>>
>>>> I ran permview on Oracle.DataAccess.dll, and here's the output:
>>>> ==================================================
>>>> Microsoft (R) .NET Framework Permission Request Viewer. Version
>>>> 1.1.4322.573
>>>> Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.
>>>>
>>>> minimal permission set:
>>>> <PermissionSet class="System.Security.PermissionSet"
>>>> version="1">
>>>> <IPermission class="System.Security.Permissions.SecurityPermission,
>>>> mscorlib,
>>>> Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
>>>> version="1"
>>>> Flags="SkipVerification"/>
>>>> </PermissionSet>
>>>>
>>>> optional permission set:
>>>> Not specified
>>>>
>>>> refused permission set:
>>>> Not specified
>>>> ==================================================
>>>>
>>>> Now what? It does appear that the Oracle.DataAccess.dll does require
>>>> some special permissions, but in my context I don't know how to
>>>> provide those permissions. Any ideas?
>>>>
>>>> Thanks!
>>>> Brad.
>>>>
>>>>
>>>> On Fri, 3 Sep 2004 08:16:38 -0400, "Nicole Calinoiu" <ngcalinoiu
>>>> REMOVETHIS AT gmail DOT com> wrote:
>>>>
>>>>>Bradley,
>>>>>
>>>>>The problem probably lies with the Oracle client requiring some
>>>>>permission
>>>>>that your code is not being granted, not with a permission that the
>>>>>Oracle
>>>>>code is not being granted. You can use permview.exe
>>>>>(http://msdn.microsoft.com/library/en-us/cptools/html/cpgrfpermissionsviewtoolpermviewexe.asp)
>>>>>to verify the permission(s) for which a RequestMinimum has been
>>>>>specified
>>>>>in
>>>>>the Oracle.DataAccess.dll assembly. If there are any required
>>>>>permissions,
>>>>>you should then use the "evaluate assembly" functionality in the .NET
>>>>>configuration manager to determine if your assembly has been granted
>>>>>these
>>>>>permissions.
>>>>>
>>>>>HTH,
>>>>>Nicole
>>>>>
>>>>>
>>>>>
>>>>>"Bradley Plett" <plettb@hotmail.com> wrote in message
>>>>>news:573fj0lnfsrcamqrj33i0ae12tj636fqde@4ax.com...
>>>>>> I've posted a similar question in the
>>>>>> microsoft.public.sqlserver.reportingsvcs group, but I need to solve
>>>>>> this and it is more of a .NET/permissions issue anyway. However, it
>>>>>> is in the context of RS' forms authentication, which is making it more
>>>>>> difficult for me to understand/debug.
>>>>>>
>>>>>> I have forms authentication in SQL RS working like a charm. (For more
>>>>>> info, see
>>>>>> http://msdn.microsoft.com/library/?url=/library/en-us/dnsql2k/html/ufairs.asp).
>>>>>> However, I am now trying to do some authentication against an Oracle
>>>>>> database. What's very strange is that as soon as I try to bind to
>>>>>> Oracle's client (Oracle.DataAccess in, by default,
>>>>>> C:\oracle\ora92\bin\Oracle.DataAccess.dll), I get
>>>>>> "System.Security.Policy.PolicyException: Required permissions cannot
>>>>>> be acquired." I've definitely narrowed it down to the Oracle binding,
>>>>>> but can't figure out how to make it work. I've looked in "Microsoft
>>>>>> .NET Framework 1.1 Configuration" under "Runtime Security Policy" and
>>>>>> did an "Evaluate Assembly", which returned "Unrestricted". I also
>>>>>> tried editing rssrvpolicy.config (in "C:\Program Files\Microsoft SQL
>>>>>> Server\MSSQL\Reporting Services\ReportServer\") to add a full trust
>>>>>> for the Oracle.DataAccess.dll, but none of this has helped. Any other
>>>>>> ideas or suggestions?
>>>>>>
>>>>>> Despite being much more capable, I often find .NET permissions much
>>>>>> more confusing, especially trying to debug this type of failure. If
>>>>>> anyone can point me to some good tools and/or techniques on this
>>>>>> topic, I'd MUCH appreciate it. I suppose part of the problem is that
>>>>>> I don't have time to read an entire book - I just want to skip to the
>>>>>> good parts! :-)
>>>>>>
>>>>>> Thanks a lot!
>>>>>> Brad.
>>>>>
>>>>
>>>
>>
>



Relevant Pages

  • Re: Please explain why the GAC cannot be referenced
    ... Gac assemblies show up under the reference tab. ... Look through you referenced assemblies for the name of the assembly, ... Gac'd assemblies provide that function for you and the search order for assemblies starts at the gac to reduce performance issues. ... > old assembly from the GAC and install the newer version. ...
    (microsoft.public.dotnet.framework)
  • Re: Please explain why the GAC cannot be referenced
    ... A point I'll make here is that the GAC is really intended as a deployment ... So development tools generally don't refer to assemblies ... product install that developers typically don't want on the dev machine. ... reference assemblies from them that happen to be installed to the GAC. ...
    (microsoft.public.dotnet.framework)
  • RE: Trying to get reference from the GAC
    ... I had assumed there was a way to say "look in the GAC" without giving it the ... the system assemblies seems be particularly ... I don't think it is safe to redirect the reference ... Microsoft MSDN Online Support Lead ...
    (microsoft.public.vsnet.general)
  • Re: Please explain why the GAC cannot be referenced
    ... I knew you could reference the GAC, ... the GAC and why in the world I still needed the physical outside of the GAC ... old assembly from the GAC and install the newer version. ... reference the assemblies in the GAC because they are not listed in the .Net ...
    (microsoft.public.dotnet.framework)
  • Re: Please explain why the GAC cannot be referenced
    ... DLL in the GAC or in the individual projects, ... old assembly from the GAC and install the newer version. ... Now Im finding out that you cant reference the GAC, ... There are other locations that the framework will look for the assemblies as well, and those places are documented in the MSDN Library documentation. ...
    (microsoft.public.dotnet.framework)