title: CCNet and .Net 4.0
body: <blockquote>
    <p>Could not load file or assembly
    'System.Data' or one of its
    dependencies. An attempt was made to
    load a program with an incorrect
    format</p>
  </blockquote>
  
  <p>We have just upgraded one of our projects to .Net 4.0 and have re-configured our build server (Cruise Control .Net). Anyone help with the above error? I have included more trace below.</p>
  
  <pre><code>&gt;     debug:
  &gt;     
  &gt;          [copy] Copying 1 file to 'C:\Builds\SilverChip\Working\sc.website\web.config'.
  &gt;          [copy] Copying 1 file to 'C:\Builds\SilverChip\Working\sc.admin\web.config'.
  &gt;          [copy] Copying 1 file to 'C:\Builds\SilverChip\Working\sc.website\bin\Intelligencia.UrlRewriter.dll'.
  &gt;          [copy] Copying 1 file to 'C:\Builds\SilverChip\Working\sc.website\bin\UrlRewritingNet.UrlRewriter.dll'.
  &gt;          [exec] Microsoft (R) Build Engine Version 4.0.30319.1
  &gt;          [exec] [Microsoft .NET Framework, Version 4.0.30319.1]
  &gt;          [exec] Copyright (C) Microsoft Corporation 2007. All rights
  &gt; reserved.
  &gt;          [exec] 
  &gt;          [exec] Build started 11/05/2010 12:02:16.
  &gt;          [exec] Project "C:\Builds\SilverChip\Working\Silverchip.sln"
  &gt; on node 1 (default targets).
  &gt;          [exec] ValidateSolutionConfiguration:
  &gt;          [exec]   Building solution configuration "Debug|Any CPU".
  &gt;          [exec] Project "C:\Builds\SilverChip\Working\Silverchip.sln"
  &gt; (1) is building
  &gt; "C:\Builds\SilverChip\Working\sc.lib\sc.lib.csproj"
  &gt; (2) on node 1 (default targets).
  &gt;          [exec] CoreCompile:
  &gt;          [exec] Skipping target "CoreCompile" because all output files
  &gt; are up-to-date with respect to the
  &gt; input files.
  &gt;          [exec] _CopyAppConfigFile:
  &gt;          [exec] Skipping target "_CopyAppConfigFile" because all
  &gt; output files are up-to-date with
  &gt; respect to the input files.
  &gt;          [exec] CopyFilesToOutputDirectory:
  &gt;          [exec]   sc.lib -&gt; C:\Builds\SilverChip\Working\sc.lib\bin\Debug\sc.lib.dll
  &gt;          [exec] Done Building Project "C:\Builds\SilverChip\Working\sc.lib\sc.lib.csproj"
  &gt; (default targets).
  &gt;          [exec] Project "C:\Builds\SilverChip\Working\Silverchip.sln"
  &gt; (1) is building
  &gt; "C:\Builds\SilverChip\Working\sc_admin.metaproj"
  &gt; (3) on node 1 (default targets).
  &gt;          [exec] Build:
  &gt;          [exec]   Copying file from "C:\Builds\SilverChip\Working\sc.lib\bin\Debug\sc.lib.dll"
  &gt; to "sc.admin\\Bin\sc.lib.dll".
  &gt;          [exec]   Copying file from "C:\Builds\SilverChip\Working\sc.lib\bin\Debug\SubSonic.Core.dll"
  &gt; to "sc.admin\\Bin\SubSonic.Core.dll".
  &gt;          [exec]   Copying file from "C:\Builds\SilverChip\Working\sc.lib\bin\Debug\sc.lib.pdb"
  &gt; to "sc.admin\\Bin\sc.lib.pdb".
  &gt;          [exec]   C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe
  &gt; -v /sc.admin -p sc.admin\ -u -f -d PrecompiledWeb\sc.admin\ 
  &gt;          [exec] ASPNETCOMPILER : error ASPCONFIG: Could not load file or
  &gt; assembly 'System.Data' or one of its
  &gt; dependencies. An attempt was made to
  &gt; load a program with an incorrect
  &gt; format.
  &gt; [C:\Builds\SilverChip\Working\sc_admin.metaproj]
  &gt;          [exec] Done Building Project "C:\Builds\SilverChip\Working\sc_admin.metaproj"
  &gt; (default targets) -- FAILED.
  &gt;          [exec] Project "C:\Builds\SilverChip\Working\Silverchip.sln"
  &gt; (1) is building
  &gt; "C:\Builds\SilverChip\Working\sc_website.metaproj"
  &gt; (4) on node 1 (default targets).
  &gt;          [exec] Build:
  &gt;          [exec]   Copying file from "C:\Builds\SilverChip\Working\sc.lib\bin\Debug\sc.lib.dll"
  &gt; to "sc.website\\Bin\sc.lib.dll".
  &gt;          [exec]   Copying file from "C:\Builds\SilverChip\Working\sc.lib\bin\Debug\SubSonic.Core.dll"
  &gt; to
  &gt; "sc.website\\Bin\SubSonic.Core.dll".
  &gt;          [exec]   Copying file from "C:\Builds\SilverChip\Working\sc.lib\bin\Debug\sc.lib.pdb"
  &gt; to "sc.website\\Bin\sc.lib.pdb".
  &gt;          [exec]   C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe
  &gt; -v /sc.website -p sc.website\ -u -f -d PrecompiledWeb\sc.website\ 
  &gt;          [exec] ASPNETCOMPILER : error ASPCONFIG: Could not load file or
  &gt; assembly 'System.Data' or one of its
  &gt; dependencies. An attempt was made to
  &gt; load a program with an incorrect
  &gt; format.
  &gt; [C:\Builds\SilverChip\Working\sc_website.metaproj]
  &gt;          [exec] Done Building Project "C:\Builds\SilverChip\Working\sc_website.metaproj"
  &gt; (default targets) -- FAILED.
  &gt;          [exec] Done Building Project "C:\Builds\SilverChip\Working\Silverchip.sln"
  &gt; (default targets) -- FAILED.
  &gt;          [exec] 
  &gt;          [exec] Build FAILED.
  &gt;          [exec] 
  &gt;          [exec] "C:\Builds\SilverChip\Working\Silverchip.sln"
  &gt; (default target) (1) -&gt;
  &gt;          [exec] "C:\Builds\SilverChip\Working\sc_admin.metaproj"
  &gt; (default target) (3) -&gt;
  &gt;          [exec] (Build target) -&gt; 
  &gt;          [exec]   ASPNETCOMPILER : error ASPCONFIG: Could not load file
  &gt; or assembly 'System.Data' or one of
  &gt; its dependencies. An attempt was made
  &gt; to load a program with an incorrect
  &gt; format.
  &gt; [C:\Builds\SilverChip\Working\sc_admin.metaproj]
  &gt;          [exec] 
  &gt;          [exec] 
  &gt;          [exec] "C:\Builds\SilverChip\Working\Silverchip.sln"
  &gt; (default target) (1) -&gt;
  &gt;          [exec] "C:\Builds\SilverChip\Working\sc_website.metaproj"
  &gt; (default target) (4) -&gt;
  &gt;          [exec]   ASPNETCOMPILER : error ASPCONFIG: Could not load file
  &gt; or assembly 'System.Data' or one of
  &gt; its dependencies. An attempt was made
  &gt; to load a program with an incorrect
  &gt; format.
  &gt; [C:\Builds\SilverChip\Working\sc_website.metaproj]
  &gt;          [exec] 
  &gt;          [exec]     0 Warning(s)
  &gt;          [exec]     2 Error(s)
  &gt;          [exec]
  </code></pre>