3

Today I turned on precompilation on our razor views.

We're using referenced assemblies for pretty much everything, including the mvc dlls and System.Web.WebPages.

At first I was getting an error that the versions of System.Web.WebPages didn't match when building locally so I added an entry to the Web.Config

<add assembly="System.Web.WebPages, Version=2.0.0.0, Culture=neutral,
 PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />

This fixed the problem which leads me to assume that the compiler is ignoring the reference hint path and the <SpecificVersion> stuff?

With this in the web.config our local builds work fine (we happen to have all the dlls in the GAC also).

Running our build script on the build server throwns the error that:

{OurPath}\web.config (44): Could not load file or assembly 'System.Web.WebPages,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of
its dependencies. The system cannot find the file specified.

What's happening here? I can see that System.Web.WebPages dll is in the bin of the compiled output so why can't the build server find it? Perhaps there's a dependency I don't know about?

Secondly, why does the hint path in the proj file seem to have no impact on the assembly being used, even when SpecificVersion is set to true?

Jamie Dixon
  • 53,019
  • 19
  • 125
  • 162
  • See what the Fusion Viewer tells you: http://msdn.microsoft.com/en-us/library/e74a18c4(v=vs.100).aspx. – Polyfun Aug 16 '12 at 16:18
  • Fusion Logger seems to be about assembly binding at run time. Our issue is a compile time issue. Do you know if there's a way to attach it to the compiler? – Jamie Dixon Aug 16 '12 at 16:24
  • Try looking into build output in visual studio (or from aspnet compiler), they should give ideas about which dependencies are not found. It'd be informative to look into actual build logs from relevant tools. – Dmitry Reznik Aug 16 '12 at 16:29
  • The build output isn't giving a lot away. When I remove the web config assembly entry locally I get an error saying that System.Web.Mvc uses version 2.0 of System.Web.WebPages which is higher than referenced version 1.0. It could be the same issue on the server but why is it ignoring both the proj and the web config? – Jamie Dixon Aug 16 '12 at 16:39

0 Answers0