无法加载文件或程序集 'System.Data'或其中一个 依赖。试图做到 加载程序不正确 格式
我们刚刚将其中一个项目升级到.Net 4.0,并重新配置了我们的构建服务器(Cruise Control .Net)。有人帮忙解决上述错误吗?我在下面列出了更多的内容。
> debug:
>
> [copy] Copying 1 file to 'C:\Builds\SilverChip\Working\sc.website\web.config'.
> [copy] Copying 1 file to 'C:\Builds\SilverChip\Working\sc.admin\web.config'.
> [copy] Copying 1 file to 'C:\Builds\SilverChip\Working\sc.website\bin\Intelligencia.UrlRewriter.dll'.
> [copy] Copying 1 file to 'C:\Builds\SilverChip\Working\sc.website\bin\UrlRewritingNet.UrlRewriter.dll'.
> [exec] Microsoft (R) Build Engine Version 4.0.30319.1
> [exec] [Microsoft .NET Framework, Version 4.0.30319.1]
> [exec] Copyright (C) Microsoft Corporation 2007. All rights
> reserved.
> [exec]
> [exec] Build started 11/05/2010 12:02:16.
> [exec] Project "C:\Builds\SilverChip\Working\Silverchip.sln"
> on node 1 (default targets).
> [exec] ValidateSolutionConfiguration:
> [exec] Building solution configuration "Debug|Any CPU".
> [exec] Project "C:\Builds\SilverChip\Working\Silverchip.sln"
> (1) is building
> "C:\Builds\SilverChip\Working\sc.lib\sc.lib.csproj"
> (2) on node 1 (default targets).
> [exec] CoreCompile:
> [exec] Skipping target "CoreCompile" because all output files
> are up-to-date with respect to the
> input files.
> [exec] _CopyAppConfigFile:
> [exec] Skipping target "_CopyAppConfigFile" because all
> output files are up-to-date with
> respect to the input files.
> [exec] CopyFilesToOutputDirectory:
> [exec] sc.lib -> C:\Builds\SilverChip\Working\sc.lib\bin\Debug\sc.lib.dll
> [exec] Done Building Project "C:\Builds\SilverChip\Working\sc.lib\sc.lib.csproj"
> (default targets).
> [exec] Project "C:\Builds\SilverChip\Working\Silverchip.sln"
> (1) is building
> "C:\Builds\SilverChip\Working\sc_admin.metaproj"
> (3) on node 1 (default targets).
> [exec] Build:
> [exec] Copying file from "C:\Builds\SilverChip\Working\sc.lib\bin\Debug\sc.lib.dll"
> to "sc.admin\\Bin\sc.lib.dll".
> [exec] Copying file from "C:\Builds\SilverChip\Working\sc.lib\bin\Debug\SubSonic.Core.dll"
> to "sc.admin\\Bin\SubSonic.Core.dll".
> [exec] Copying file from "C:\Builds\SilverChip\Working\sc.lib\bin\Debug\sc.lib.pdb"
> to "sc.admin\\Bin\sc.lib.pdb".
> [exec] C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe
> -v /sc.admin -p sc.admin\ -u -f -d PrecompiledWeb\sc.admin\
> [exec] ASPNETCOMPILER : error ASPCONFIG: 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.
> [C:\Builds\SilverChip\Working\sc_admin.metaproj]
> [exec] Done Building Project "C:\Builds\SilverChip\Working\sc_admin.metaproj"
> (default targets) -- FAILED.
> [exec] Project "C:\Builds\SilverChip\Working\Silverchip.sln"
> (1) is building
> "C:\Builds\SilverChip\Working\sc_website.metaproj"
> (4) on node 1 (default targets).
> [exec] Build:
> [exec] Copying file from "C:\Builds\SilverChip\Working\sc.lib\bin\Debug\sc.lib.dll"
> to "sc.website\\Bin\sc.lib.dll".
> [exec] Copying file from "C:\Builds\SilverChip\Working\sc.lib\bin\Debug\SubSonic.Core.dll"
> to
> "sc.website\\Bin\SubSonic.Core.dll".
> [exec] Copying file from "C:\Builds\SilverChip\Working\sc.lib\bin\Debug\sc.lib.pdb"
> to "sc.website\\Bin\sc.lib.pdb".
> [exec] C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe
> -v /sc.website -p sc.website\ -u -f -d PrecompiledWeb\sc.website\
> [exec] ASPNETCOMPILER : error ASPCONFIG: 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.
> [C:\Builds\SilverChip\Working\sc_website.metaproj]
> [exec] Done Building Project "C:\Builds\SilverChip\Working\sc_website.metaproj"
> (default targets) -- FAILED.
> [exec] Done Building Project "C:\Builds\SilverChip\Working\Silverchip.sln"
> (default targets) -- FAILED.
> [exec]
> [exec] Build FAILED.
> [exec]
> [exec] "C:\Builds\SilverChip\Working\Silverchip.sln"
> (default target) (1) ->
> [exec] "C:\Builds\SilverChip\Working\sc_admin.metaproj"
> (default target) (3) ->
> [exec] (Build target) ->
> [exec] ASPNETCOMPILER : error ASPCONFIG: 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.
> [C:\Builds\SilverChip\Working\sc_admin.metaproj]
> [exec]
> [exec]
> [exec] "C:\Builds\SilverChip\Working\Silverchip.sln"
> (default target) (1) ->
> [exec] "C:\Builds\SilverChip\Working\sc_website.metaproj"
> (default target) (4) ->
> [exec] ASPNETCOMPILER : error ASPCONFIG: 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.
> [C:\Builds\SilverChip\Working\sc_website.metaproj]
> [exec]
> [exec] 0 Warning(s)
> [exec] 2 Error(s)
> [exec]
答案 0 :(得分:1)
我通过删除BIN文件夹中的所有DLL并允许构建重新加载新的.net 4.0 DLL来修复此问题