views:

48

answers:

1

Bit of a strange one here guys.

We have a fairly complex (111 projects spread across asp.net, silverlight, WFC, Ria Services etc) solution, which builds correctly on my dev box (2010). If I fire up VS on our build machine, I can also build the solution correctly. However, when I queue a build, it almost makes it through, until it attempts to run SGen - at which point I get the old "Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information." chestnut.

I've googled to try to find a solution, but nothing appears to do the job - the error is occurring at complile time rather than runtime, and I've added the v2 activation key to Team build host's config file to no effect. There are no tests in the solution which might cause things to be loaded.

Any ideas? Anyone? Particularly confused that VS can build ok on the server, but team build fails.

A: 

The following trick has worked for me (ref.)

Edit (or create if not exists) sgen.exe.config that should be located under C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\ And add:

<startup useLegacyV2RuntimeActivationPolicy="true">
  <supportedRuntime version="v4.0"/>
</startup>

As far as I understand, adding the same snippet in the app.config of the project might no be sufficient as it's not read by the sgen tool :(

Yann Trevin