none
Can <codebase> work with a URI path, or are we doomed to "HTTP download of assemblies has been disabled for this appdomain"? RRS feed

  • Question

  • I see lots of examples of redirecting the CLR to an http assembly cache using the <codebase> element, and just about as many forum posts indicating users could never get it to work.

    I am ferverently attempting to get this to work as it would greatly simplify deployments, since both my intranet and DMZ servers could point to a common assembly cache with no GAC editing, but I'm running into the same error that everyone else seems unable to solve: the default app domain does not enable http download of assemblies.

    web.config:
      <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="FSMB.Web.Common"
                              publicKeyToken="d196bd6a4e6953e6"
                              culture="neutral" />
            <codeBase version="1.0.0.0"
                      href="http://svr-app-2.fsmb.org/Shared Assemblies/FSMB.Web.Common.dll"/>
          </dependentAssembly>
        </assemblyBinding>
      </runtime>


    The error:
    FileLoadException: Could not load file or assembly 'FSMB.Web.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d196bd6a4e6953e6' or one of its dependencies. HTTP download of assemblies has been disabled for this appdomain. (Exception from HRESULT: 0x80131048)]
       FSMB.SIX.UI.Global.Application_AuthenticateRequest(Object sender, EventArgs e) in c:\Projects\WebSite\SecureInfoAccess\Global.asax.cs:98
       System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75



    fusion log:

    The operation failed.
    Bind result: hr = 0x80131048. No description available.

    Assembly manager loaded from:  c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
    Running under executable  C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_wp.exe
    --- A detailed error log follows.

    === Pre-bind state information ===
    LOG: User = NT AUTHORITY\SYSTEM
    LOG: DisplayName = FSMB.Web.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d196bd6a4e6953e6
     (Fully-specified)
    LOG: Appbase = file:///c:/Projects/WebSite/SecureInfoAccess/
    LOG: Initial PrivatePath = c:\Projects\WebSite\SecureInfoAccess\bin
    LOG: Dynamic Base = c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\six\8fc2e094
    LOG: Cache Base = c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\six\8fc2e094
    LOG: AppName = b3d45275
    Calling assembly : FSMB.SIX.UI, Version=1.0.3366.28131, Culture=neutral, PublicKeyToken=null.
    ===
    LOG: This bind starts in default load context.
    LOG: Using application configuration file: c:\Projects\WebSite\SecureInfoAccess\web.config
    LOG: Using host configuration file: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet.config
    LOG: Using machine configuration file from c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
    LOG: Post-policy reference: FSMB.Web.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d196bd6a4e6953e6
    LOG: GAC Lookup was unsuccessful.
    LOG: Attempting download of new URL http://svr-app-2.fsmb.org/Shared Assemblies/FSMB.Web.Common.dll.




    Thanks!


    James
    Saturday, March 21, 2009 3:59 AM

Answers

  • This is some documentation for the error:

    /// This error indicates that AppDomainSetup.DisallowCodeDownload has been set
    /// on the domain. Setting his flag prevents any http:// download of
    /// assemblies (or configuration files). ASP.NET sets this flag by default
    /// because the internal usage of wininet/urlmon to download bits over
    /// http:// is not supported under service processes.

    Sounds like a showstopper to me, given that ASP.NET runs inside a service.  Ask questions about it at forums.asp.net


    Hans Passant.
    • Marked as answer by Zhi-Xin Ye Thursday, March 26, 2009 10:16 AM
    Saturday, March 21, 2009 2:35 PM
    Moderator