Note that there are some explanatory texts on larger screens.

plurals
  1. POAsp.net not applying dependentAssembly/codeBase hint
    primarykey
    data
    text
    <p>I am attempting to implement <a href="https://stackoverflow.com/a/10936596/1371084">this workaround</a> for a problem where RazorEngine is not deployable in a Razor 2.0 application since it relies on the incompatible Razor 1.0.</p> <p>What I have done is created two directories in the bin folder: 1.0 and 2.0 and placed the respective System.Web.Razor.dll files into each. I then added dependentAssembly/codeBase hints to web.config to point the assembly loader in the right direction.</p> <p>However, I cannot seem to get Asp.net to honor the codeBase overrides I have applied for the System.Web.Razor assembly. The result is that System.Web.Razor 1.0.0.0 cannot be loaded for use by RazorEngine.</p> <p>Web.config</p> <pre><code>&lt;configuration&gt; &lt;runtime xmlns=""&gt; &lt;assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"&gt; &lt;dependentAssembly&gt; &lt;assemblyIdentity name="System.Web.Razor" publicKeyToken="31bf3856ad364e35" culture="neutral" /&gt; &lt;codeBase version="1.0.0.0" href="file://c:\apps\lr2\web\arcs\bin\1.0\System.Web.Razor.dll" /&gt; &lt;codeBase version="2.0.0.0" href="file://c:\apps\lr2\web\arcs\bin\2.0\System.Web.Razor.dll" /&gt; &lt;/dependentAssembly&gt; &lt;/assemblyBinding&gt; &lt;/runtime&gt; &lt;/configuration&gt; </code></pre> <p>Output from Fusion assembly loading log for System.Web.Razor 1.0.0.0:</p> <blockquote> <p>LOG: User = NT AUTHORITY\SYSTEM LOG: DisplayName = System.Web.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 (Fully-specified)</p> <p>LOG: Appbase = file:///C:/apps/lr2/web/arcs/</p> <p>LOG: Initial PrivatePath = C:\apps\lr2\web\arcs\bin</p> <p>LOG: Dynamic Base = C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\a63cc915</p> <p>LOG: Cache Base = C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\a63cc915</p> <p>LOG: AppName = 98966cc9</p> <p>Calling assembly : RazorEngine, Version=3.0.8.0, Culture=neutral, PublicKeyToken=9ee697374c7e744a.</p> <p>LOG: This bind starts in default load context.</p> <p>LOG: Using application configuration file: C:\apps\lr2\web\arcs\web.config</p> <p>LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet.config</p> <p>LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.</p> <p>LOG: Post-policy reference: System.Web.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35</p> <p>LOG: GAC Lookup was unsuccessful.</p> <p>LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/a63cc915/98966cc9/System.Web.Razor.DLL.</p> <p>LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/a63cc915/98966cc9/System.Web.Razor/System.Web.Razor.DLL.<br> LOG: Attempting download of new URL file:///C:/apps/lr2/web/arcs/bin/System.Web.Razor.DLL.</p> <p>LOG: Attempting download of new URL file:///C:/apps/lr2/web/arcs/bin/System.Web.Razor/System.Web.Razor.DLL.</p> <p>LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/a63cc915/98966cc9/System.Web.Razor.EXE.</p> <p>LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/a63cc915/98966cc9/System.Web.Razor/System.Web.Razor.EXE.</p> <p>LOG: Attempting download of new URL file:///C:/apps/lr2/web/arcs/bin/System.Web.Razor.EXE.</p> <p>LOG: Attempting download of new URL file:///C:/apps/lr2/web/arcs/bin/System.Web.Razor/System.Web.Razor.EXE.</p> <p>LOG: All probing URLs attempted and failed.</p> </blockquote> <p>Any idea why Asp.net never attempts to dig down into bin\1.0?</p> <p>I did check machine.config and there is no sign of a conflicting assemblyBinding.</p> <p>Appreciate the help!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload