« Previous Next »

Answered Thread: UNC source for IIS 6 ASP.NET 2.0 web site

Last post 06-16-2009 7:22 AM by usmhot. 10 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (11 items)

Sort Posts:

  • 06-15-2009, 4:29 AM

    • usmhot
    • Not Ranked
    • Joined on 05-17-2007, 6:34 AM
    • Posts 6

    UNC source for IIS 6 ASP.NET 2.0 web site

    Hi,

    I'm trying to create an ASP.NET 2.0 Website on IIS 6 on Windows Server 2003 with the source directory being a 'share located on another computer'.

    When I place a simple test html document in the web site (on the UNC share) I can browse successfully to it. However, I'm getting the following exception when I try to browse aspx pages on the website System.Security.SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, ... ' failed.

    I have ensured the UNC share is fully accessible by 'Everyone' and 'ANONYMOUS LOGON' and that the local security policy allows anonymous access for the share. So, I can anonymously connect to the share and carry out read and write operations.

    I've spent some time trying to find out what the problem is and have come across a number of suggestions, such as trying to grant FullTrust for the UNC on the server (http://support.microsoft.com/?id=320268) or adding the same user on both the IIS server and the server presenting the UNC share (eg. http://forums.devshed.com/iis-97/iis-unc-share-487829.html). None of these solutions has worked for me.

    Can someone tell me what I'm doing wrong? Or how to use a UNC for the source of an IIS ASP.NET 2.0 web site?

    usmhot
  • 06-15-2009, 4:44 AM In reply to

    • lextm
    • Top 10 Contributor
    • Joined on 10-22-2008, 4:18 AM
    • Shanghai, PRC
    • Posts 1,423

    Re: UNC source for IIS 6 ASP.NET 2.0 web site

    What about the simplest ASP.NET page? If a hello world page still failed, I suggest you copy more error message here. We cannot guess what exception you saw.

    Thanks,

    Lex Li
    Support Engineer at Microsoft
    ---------------------------
    This posting is provided "AS IS" with no warranties, and confers no rights.
  • 06-15-2009, 4:45 AM In reply to

    Re: UNC source for IIS 6 ASP.NET 2.0 web site

    Hi,

    The command listed in KB 320268 should work - it works for me. The correct syntax should be as follows :

    CD \WINDOWS\Microsoft.NET\Framework\v2.0.50727

    followed by :

    caspol.exe -m -ag 1 -url "file:////\\server\sharename\*" FullTrust -exclusive on

    Regards,

    Paul Lynch | www.iisadmin.co.uk
  • 06-15-2009, 5:01 AM In reply to

    • usmhot
    • Not Ranked
    • Joined on 05-17-2007, 6:34 AM
    • Posts 6

    Re: UNC source for IIS 6 ASP.NET 2.0 web site

    Hi lextm,

     I tried a simple aspx page - body is just

    <body>
        <form id="form1" runat="server">
        <div>
            <asp:Label ID="Label1" runat="server" Text="This is a aspx test"></asp:Label></div>
        </form>
    </body>

    and still get the same error - copied here

     

    Security Exception

    Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

    Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
       System.Reflection.Assembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase) +0
       System.Reflection.Assembly.GetType(String name, Boolean throwOnError) +12
       System.Web.Compilation.BuildResultCompiledType.GetPreservedAttributes(PreservationFileReader pfr) +73
       System.Web.Compilation.PreservationFileReader.ReadFileInternal(VirtualPath virtualPath, String preservationFile, Int64 hashCode) +630
       System.Web.Compilation.PreservationFileReader.ReadBuildResultFromFile(VirtualPath virtualPath, String preservationFile, Int64 hashCode) +79
       System.Web.Compilation.DiskBuildResultCache.GetBuildResult(String cacheKey, VirtualPath virtualPath, Int64 hashCode) +71
       System.Web.Compilation.BuildManager.GetBuildResultFromCacheInternal(String cacheKey, Boolean keyFromVPP, VirtualPath virtualPath, Int64 hashCode) +166
       System.Web.Compilation.ApplicationBuildProvider.GetGlobalAsaxBuildResult(Boolean isPrecompiledApp) +65
       System.Web.Compilation.BuildManager.CompileGlobalAsax() +51
       System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +462
    

    usmhot
  • 06-15-2009, 5:03 AM In reply to

    • usmhot
    • Not Ranked
    • Joined on 05-17-2007, 6:34 AM
    • Posts 6

    Re: UNC source for IIS 6 ASP.NET 2.0 web site

    Hi Paul,

     I've tried that command a few times - both on the command line and through the 'Microsoft .NET Framework 2.0 Configuration' tool. Didn't work.

     I'll try again - copying exactly your instructions, in case I've missed something.

    usmhot
  • 06-15-2009, 5:10 AM In reply to

    • usmhot
    • Not Ranked
    • Joined on 05-17-2007, 6:34 AM
    • Posts 6

    Re: UNC source for IIS 6 ASP.NET 2.0 web site

    Nope - no joy - exactly the same error.

    I'd wonder if there was a domain level security policy overriding my local securith policies (I know very little about security), but the fact that the exact same error is occuring in the live environment which is not domain based suggests that it is not this.

    usmhot
  • 06-15-2009, 5:51 AM In reply to

    Re: UNC source for IIS 6 ASP.NET 2.0 web site

    Hi,

    To check that the group was successfully created try running caspol -listgroups from the .Net 2.0 framework folder.

    I can't think what would cause this to fail.

    Regards,

    Paul Lynch | www.iisadmin.co.uk
  • 06-15-2009, 5:55 AM In reply to

    Answered Re: UNC source for IIS 6 ASP.NET 2.0 web site

    Ensure that URL that you are passing is same of in caspol.

    caspol.exe -m -ag 1 -url "file:////\\server\sharename\*" FullTrust -exclusive on

    If it is netbios name use that, if it is FQDN, use that in caspol and then do iisreset and test.

    Try Url with IP address as well.

    BTW, are you using share as $ share?

    ~ Ganesh

  • 06-15-2009, 8:36 AM In reply to

    • usmhot
    • Not Ranked
    • Joined on 05-17-2007, 6:34 AM
    • Posts 6

    Re: UNC source for IIS 6 ASP.NET 2.0 web site

    Right ... progress (thanks ganeshanekar) ... I had referenced the share by ip in IIS, but had added the trust policy by computer name.

    So, having ensured that both the IIS and the policy refernce by ip address I moved onto a different error about the impersonating user - which I resolved by creating the same local account on both machines and using the unqualified account name as my impersonate user.

    Now, I'm getting the following error

    Configuration Error

    Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

    Parser Error Message: An error occurred loading a configuration file: Failed to start monitoring changes to '...\Release\_PublishedWebsites\Web_deploy\admin' because the network BIOS command limit has been reached. For more information on this error, please refer to Microsoft knowledge base article 810886. Hosting on a UNC share is not supported for the Windows XP Platform.

    Source Error:

    [No relevant source lines]


    Source File: \\...\Release\_PublishedWebsites\Web_deploy\admin\web.config  Line: 0

    Which I've tried to fix by following the advice in the referenced KB aritcle - to no avail.

    usmhot
  • 06-16-2009, 7:22 AM In reply to

    • usmhot
    • Not Ranked
    • Joined on 05-17-2007, 6:34 AM
    • Posts 6

    Re: UNC source for IIS 6 ASP.NET 2.0 web site

    Thanks Tom ... was a helpful article.

    Didn't get this to work properly in my development environment (domain based), but actually did get it to work in the live environment (workgroup based).

    Thanks all for your help.

    usmhot
Page 1 of 1 (11 items)
Microsoft Communities