locked
Virtual Directory - Required permissions cannot be acquired RRS feed

  • Question

  • Hi

    I am using SharePoint Foundation 2010. I need to set up an web service application that is implemented as a virtual directory under my SharePoint 80 site. I have set the virtual directory to be an application. When I attempt to access the web services I get a "Required permissions cannot be acquired" exception listing one of the dlls in my application as a problem. I clearly need to raise the trust level for this dll in the application.

    Following advice in other threads I have tried changing the trust level in "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\CONFIG\web.config" and "C:\inetpub\wwwroot\wss\VirtualDirectories\80.web.config" to

    <trust level="Full" originUrl="" />

    When I do this I get "The farm is unavailable" for my web services (the SharePoint site appears to be operating normally). I should mention here that the site is set up with claims/forms authentication and the exception is at Microsoft.SharePoint.Administration.Claims.SPSecurityTokenServiceManager.get_Local() when full trust is applied.

    I have also tried adding the <trust level="Full" originUrl="" /> to my web service applications web.config but this leads to the same error.

    Any advice on what to do next would be greatly appreciated.


    Andrew Wiles - www.it-workplace.com - MDX made simple
    Thursday, December 2, 2010 2:13 PM

Answers

  • I did find the solution to this problem in the end and it is rather embarassing :-(

    I had changed the namespace for one of my web services to something invalid. This did not show up when testing the web service in debug mode but became apparent when I tried to test it outside of SharePoint.

    Not a good day at the office.......


    Andrew Wiles - www.it-workplace.com - MDX made simple
    • Marked as answer by Andrew Wiles Friday, January 7, 2011 7:56 AM
    Friday, January 7, 2011 7:56 AM

All replies

  • Do you get the error "The farm is unavailable" for your custom web service or OOB web services as well?

     

    Also, could you provide us the call stack while accessing the site as per the steps listed below:

    To enable the CallStack attribute

    1.In Windows Explorer, browse to the following folder:

    local_drive:\InetPub\WWWRoot\bin\

    2.Double-click the Web.config file.

    3.In the Web.config file, search for the <SharePoint> element.

    4.In the <SharePoint> element, locate the <SafeMode MaxControls="50" CallStack="false"/> tag and change it to <SafeMode MaxControls="50" CallStack="true"/>.

    5.Save and close the file.

    When exceptions occur, you now receive ASP.NET exception messages with stack trace information.

     

    To enable ASP.NET tracing on a local server

    1.In Windows Explorer, browse to the following folder:

    local_drive:\InetPub\WWWRoot\bin\.

     

    2.Double-click the Web.config file.

    3.In the Web.config file, search for the <system.web> element.

    4.In the <system.web> element, add the following line:

    <trace enabled="true" pageOutput="true"/>

     

    Also ensure  <trust level="Full" originUrl="" />  is set on the web application Web.config file.

    So that we can investigate further on the issue.


    Please remember to click 'Mark as Answer' on the post that helps you or click 'Unmark as Answer' if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Regards,
    Nishant Shah
    Microsoft Online Community Support
    Monday, December 13, 2010 12:45 PM
  • Can you check that your Virtual Directory is using the same application pool as the SharePoint site it is running under. Is the DLL within the GAC? If so then it is not the DLL that needs looking at.

    Liam

    Monday, December 13, 2010 3:21 PM
  • I did find the solution to this problem in the end and it is rather embarassing :-(

    I had changed the namespace for one of my web services to something invalid. This did not show up when testing the web service in debug mode but became apparent when I tried to test it outside of SharePoint.

    Not a good day at the office.......


    Andrew Wiles - www.it-workplace.com - MDX made simple
    • Marked as answer by Andrew Wiles Friday, January 7, 2011 7:56 AM
    Friday, January 7, 2011 7:56 AM