Vb.net &引用;“格式不正确”;在TeamCity中构建Web部署项目时发生引用错误

Vb.net &引用;“格式不正确”;在TeamCity中构建Web部署项目时发生引用错误,vb.net,deployment,msbuild,teamcity,web-deployment-project,Vb.net,Deployment,Msbuild,Teamcity,Web Deployment Project,几天前,我开始设置TeamCity服务器,用于自动化测试和CI。我们主要做VB.net网络应用程序,到目前为止,它一直在检查东西并构建良好 当我试图将实际部署添加到组合中时,出现了一个问题。我看到这篇文章: 作为一个很好的指南,我到处引用,所以我遵循了与设置Web部署项目和操纵TeamCity来运行它相关的步骤。基本上,它建议在VS2010中设置一个名为“部署”的新构建配置,用于构建Web部署项目,然后在TC中创建一个以该项目为目标的构建配置 问题是web部署项目在TeamCity下运行时无法

几天前,我开始设置TeamCity服务器,用于自动化测试和CI。我们主要做VB.net网络应用程序,到目前为止,它一直在检查东西并构建良好

当我试图将实际部署添加到组合中时,出现了一个问题。我看到这篇文章:

作为一个很好的指南,我到处引用,所以我遵循了与设置Web部署项目和操纵TeamCity来运行它相关的步骤。基本上,它建议在VS2010中设置一个名为“部署”的新构建配置,用于构建Web部署项目,然后在TC中创建一个以该项目为目标的构建配置

问题是web部署项目在TeamCity下运行时无法编译。常规生成工作正常,但如果我将MSBuild设置为使用包含Web部署项目的生成配置,它会在中途崩溃,并在尝试以错误格式加载System.Data.OracleClient程序集时出错。我假设这意味着一个32位/64位错误,特别是因为我的开发机器是一个32位的盒子,构建服务器是64位的,但我不知道为什么会发生这种情况,特别是当常规构建工作正常时,并且我的项目中没有任何内容涉及使用Oracle数据库

我在日志中看到有一条关于4.0框架缺少引用程序集的警告,因此我前往微软网站下载了SDK,但这并没有改变任何事情。在这一点上,我被卡住了,我没有在堆栈溢出上看到任何类似的东西。我将把日志附在下面。我错过了一些简单的事情吗?还有人遇到这样的问题吗

[10:46:05]: Project "MyTools.sln.teamcity.patch.tcprojx" (TeamCity_Generated_Build target(s)):
[10:46:05]:  [Project "MyTools.sln.teamcity.patch.tcprojx" (TeamCity_Generated_Build target(s)):] Project "MyTools.sln" (Rebuild target(s)):
[10:46:05]:   [Project "MyTools.sln" (Rebuild target(s)):] Building solution configuration "Deployment|Any CPU".
[10:46:05]:   [Project "MyTools.sln" (Rebuild target(s)):] Project "MyTools.vbproj" (Rebuild target(s)):
[10:46:05]:    [Project "MyTools.vbproj" (Rebuild target(s)):] Creating directory "obj\Deployment\".
[10:46:05]:    [Project "MyTools.vbproj" (Rebuild target(s)):] Project "MyLib.vbproj" (Clean target(s)):
[10:46:05]:     [Project "MyLib.vbproj" (Clean target(s)):] Creating directory "obj\Deployment\".
[10:46:05]:    [Project "MyTools.vbproj" (Rebuild target(s)):] Project "AutomatedFrontEndClasses.vbproj" (Clean target(s)):
[10:46:05]:     [Project "AutomatedFrontEndClasses.vbproj" (Clean target(s)):] Creating directory "obj\Deployment\".
[10:46:05]:     [Project "AutomatedFrontEndClasses.vbproj" (Clean target(s)):] Project "MyLib.vbproj" (Clean target(s)):
[10:46:05]:    [Project "MyTools.vbproj" (Rebuild target(s)):] C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(847, 9): warning MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.0" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.
[10:46:05]:    [Project "MyTools.vbproj" (Rebuild target(s)):] Project "MyLib.vbproj" (default targets):
[10:46:05]:     [Project "MyLib.vbproj" (default targets):] C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(847, 9): warning MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.0" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.
[10:46:05]:     [Project "MyLib.vbproj" (default targets):] Creating directory "bin\Deployment\".
[10:46:09]:     [Project "MyLib.vbproj" (default targets):] C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Vbc.exe /noconfig /imports:Microsoft.VisualBasic,System,System.Collections,System.Collections.Generic,System.Data,System.Diagnostics,System.Linq /optioncompare:Text /optionstrict+ /optioninfer- /nostdlib /rootnamespace:MyLib /sdkpath:C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319 /define:"CONFIG=\"Deployment\",_MyType=\"Windows\",PLATFORM=\"AnyCPU\"" /link:D:\TeamCityBuildAgent\work\c18407eaf8486b52\MyLib\MyLib\bin\Microsoft.Office.Interop.Word.dll /reference:C:\WINDOWS\assembly\GAC_MSIL\Microsoft.SqlServer.ConnectionInfo\10.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.ConnectionInfo.dll,C:\WINDOWS\assembly\GAC_MSIL\Microsoft.SqlServer.Management.Sdk.Sfc\10.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.Management.Sdk.Sfc.dll,C:\WINDOWS\assembly\GAC_MSIL\Microsoft.SqlServer.Smo\10.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.Smo.dll,C:\WINDOWS\assembly\GAC_MSIL\Microsoft.SqlServer.SqlEnum\10.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.SqlEnum.dll,D:\TeamCityBuildAgent\work\c18407eaf8486b52\MyLib\MyLib\bin\NVelocity.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.ComponentModel.DataAnnotations\v4.0_4.0.0.0__31bf3856ad364e35\System.ComponentModel.DataAnnotations.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.configuration.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Data.DataSetExtensions\v4.0_4.0.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Data.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Data.Linq.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.DirectoryServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.DirectoryServices.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Security\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Security.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel\v4.0_4.0.0.0__b77a5c561934e089\System.ServiceModel.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Web\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Web.Abstractions\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.Abstractions.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Web.ApplicationServices\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.ApplicationServices.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.Web\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Web.Extensions\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.Extensions.dll,"C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 2\Assemblies\System.Web.Mvc.dll",C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Web.Services\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll /out:obj\Deployment\MyLib.dll /resource:obj\Deployment\MyLib.Resources.resources /resource:obj\Deployment\MyLib.Logos.resources /resource:obj\Deployment\MyLib.Scorecard.resources /resource:obj\Deployment\MyLib.keys.resources /resource:Client\RockCounty\QuarterlyPtsSummaryPdfPage1.xhtml.vm,MyLib.QuarterlyPtsSummaryPdfPage1.xhtml.vm /resource:Client\RockCounty\QuarterlyPtsSummaryPdfPage1Apology.xhtml.vm,MyLib.QuarterlyPtsSummaryPdfPage1Apology.xhtml.vm /resource:Client\Convergys\ConvergysKyrkynChecklist.xhtml.vm,MyLib.ConvergysKyrkynChecklist.xhtml.vm /resource:Client\RockCounty\QuarterlyPtsSummaryPdfPage2.xhtml.vm,MyLib.QuarterlyPtsSummaryPdfPage2.xhtml.vm /resource:Client\RockCounty\RockCountyPtsFaxPdf.xhtml.vm,MyLib.RockCountyPtsFaxPdf.xhtml.vm /resource:Resources\NVelocity\WelcomeLetterReport.vm,MyLib.WelcomeLetterReport.vm /resource:Client\ValleyView\ValleyViewChecklistPdfResources.zip,MyLib.ValleyViewChecklistPdfResources.zip /resource:Client\Sjchs\SjchsChecklistPdfResources.zip,MyLib.SjchsChecklistPdfResources.zip /resource:Providers\PcpAutoSelect\PcpAutoSelectPdfResources.zip,MyLib.PcpAutoSelectPdfResources.zip /resource:Resources\NatLimeKyrkynChecklistPdfResources.zip,MyLib.NatLimeKyrkynChecklistPdfResources.zip /resource:Resources\ConvergysKyrkynChecklistPdfResources.zip,MyLib.ConvergysKyrkynChecklistPdfResources.zip /resource:Resources\KyrkynScorecardPdfResources.zip,MyLib.KyrkynScorecardPdfResources.zip /resource:Client\Sjchs\SjchsChecklistPage1.htm,MyLib.SjchsChecklistPage1.htm /resource:Client\Sjchs\SjchsChecklistPage2.htm,MyLib.SjchsChecklistPage2.htm /resource:Providers\PcpAutoSelect\PcpAutoSelectNotificationPage1.htm,MyLib.PcpAutoSelectNotificationPage1.htm /resource:Providers\PcpAutoSelect\PcpAutoSelectNotificationPage2.htm,MyLib.PcpAutoSelectNotificationPage2.htm /resource:Client\Watco\WatcoPCPForm.pdf,MyLib.WatcoPCPForm.pdf /resource:Client\Watco\Watco-Newsletter3.pdf,MyLib.Watco-Newsletter3.pdf /resource:Client\WAICU\WAICU_Checklist_Back.pdf,MyLib.WAICU_Checklist_Back.pdf /resource:Client\WAICU\WAICU_Checklist_FrontBG.pdf,MyLib.WAICU_Checklist_FrontBG.pdf /resource:Client\WAICU\WAICU_FrontBG_ALL_YES.pdf,MyLib.WAICU_FrontBG_ALL_YES.pdf /resource:Client\WAICU\WAICU_KYRKYNCard.pdf,MyLib.WAICU_KYRKYNCard.pdf /resource:Client\RockCounty\RockCountyPtsFax.pdf,MyLib.RockCountyPtsFax.pdf /resource:Client\ValleyView\UpdValleyViewChecklistReqs.sql,MyLib.UpdValleyViewChecklistReqs.sql /resource:Client\ValleyView\SelValleyViewChecklistReqs.sql,MyLib.SelValleyViewChecklistReqs.sql /resource:Providers\PcpAutoSelect\SelPcpAutoSelectData.sql,MyLib.SelPcpAutoSelectData.sql /resource:Client\NatLime\SqlNatLimeKyrkynChecklistData.sql,MyLib.SqlNatLimeKyrkynChecklistData.sql /resource:Client\Convergys\SqlConvergysKyrkynChecklistData.sql,MyLib.SqlConvergysKyrkynChecklistData.sql /resource:Client\Sjchs\SjchsEligTrackingChecklist.xml,MyLib.SjchsEligTrackingChecklist.xml /resource:Resources\XML\SSN.xml,MyLib.SSN.xml /resource:Client\WAICU\WAICU_CheckedBoxLarge.jpg,MyLib.WAICU_CheckedBoxLarge.jpg /resource:Client\WAICU\WAICU_UncheckedBoxLarge.jpg,MyLib.WAICU_UncheckedBoxLarge.jpg /resource:Client\WAICU\WAICU_WarningBox1.png,MyLib.WAICU_WarningBox1.png /resource:Resources\XSLT\Beautify.xslt,MyLib.Beautify.xslt /resource:Resources\XSLT\CompressWhitespace.xslt,MyLib.CompressWhitespace.xslt /target:library ...giant list of source files... "D:\TeamCityBuildAgent\temp\buildTmp\.NETFramework,Version=v4.0.AssemblyAttributes.vb"
[10:46:18]:     [Project "MyLib.vbproj" (default targets):] MyLib -> D:\TeamCityBuildAgent\work\c18407eaf8486b52\MyLib\MyLib\bin\Deployment\MyLib.dll
[10:46:18]:    [Project "MyTools.vbproj" (Rebuild target(s)):] Project "AutomatedFrontEndClasses.vbproj" (default targets):
[10:46:18]:     [Project "AutomatedFrontEndClasses.vbproj" (default targets):] C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(847, 9): warning MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.0" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.
[10:46:18]:     [Project "AutomatedFrontEndClasses.vbproj" (default targets):] Creating directory "bin\Deployment\".
[10:46:18]:     [Project "AutomatedFrontEndClasses.vbproj" (default targets):] Project "MyLib.vbproj" (default targets):
[10:46:18]:     [Project "AutomatedFrontEndClasses.vbproj" (default targets):] Project "MyLib.vbproj" (GetNativeManifest target(s)):
[10:46:18]:     [Project "AutomatedFrontEndClasses.vbproj" (default targets):] Processing resource file "My Project\Resources.resx" into "obj\Deployment\AutomatedFrontEndClasses.Resources.resources".
[10:46:18]:     [Project "AutomatedFrontEndClasses.vbproj" (default targets):] Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
[10:46:18]:     [Project "AutomatedFrontEndClasses.vbproj" (default targets):] C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Vbc.exe /noconfig /imports:Microsoft.VisualBasic,System,System.Collections,System.Collections.Generic,System.Data,System.Diagnostics,System.Linq,System.Xml.Linq /optioncompare:Binary /optionexplicit+ /optionstrict:custom /optioninfer+ /nostdlib /rootnamespace:AutomatedFrontEndClasses /sdkpath:C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319 /define:"CONFIG=\"Deployment\",_MyType=\"Windows\",PLATFORM=\"AnyCPU\"" /reference:D:\TeamCityBuildAgent\work\c18407eaf8486b52\MyTools\AutomatedFrontEndClasses\bin\ceTe.DynamicPDF.20.dll,D:\TeamCityBuildAgent\work\c18407eaf8486b52\MyLib\MyLib\bin\Deployment\MyLib.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Data.DataSetExtensions\v4.0_4.0.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Data.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Data.Linq.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll /filealign:512 /out:obj\Deployment\AutomatedFrontEndClasses.dll /resource:obj\Deployment\AutomatedFrontEndClasses.Resources.resources /target:library Checklist\SJCHSChecklistGen.vb Checklist\ValleyViewChecklistGen.vb Config.vb ExportedClassAttribute.vb ExportedMethodAttribute.vb ExportedParameterAttribute.vb Misc\PcpAutoSelectLetterGen.vb "My Project\AssemblyInfo.vb" "My Project\Application.Designer.vb" "My Project\Resources.Designer.vb" "My Project\Settings.Designer.vb" PluginBaseClass.vb Scorecard\ScorecardGen.vb Test\TestChecklistGen.vb "D:\TeamCityBuildAgent\temp\buildTmp\.NETFramework,Version=v4.0.AssemblyAttributes.vb"
[10:46:19]:     [Project "AutomatedFrontEndClasses.vbproj" (default targets):] Project "MyLib.vbproj" (GetCopyToOutputDirectoryItems target(s)):
[10:46:19]:     [Project "AutomatedFrontEndClasses.vbproj" (default targets):] Copying file from "obj\Deployment\AutomatedFrontEndClasses.dll" to "bin\Deployment\AutomatedFrontEndClasses.dll".
[10:46:19]:     [Project "AutomatedFrontEndClasses.vbproj" (default targets):] AutomatedFrontEndClasses -> D:\TeamCityBuildAgent\work\c18407eaf8486b52\MyTools\AutomatedFrontEndClasses\bin\Deployment\AutomatedFrontEndClasses.dll
[10:46:19]:    [Project "MyTools.vbproj" (Rebuild target(s)):] Project "MyLib.vbproj" (GetNativeManifest target(s)):
[10:46:19]:    [Project "MyTools.vbproj" (Rebuild target(s)):] Project "AutomatedFrontEndClasses.vbproj" (GetNativeManifest target(s)):
[10:46:19]:    [Project "MyTools.vbproj" (Rebuild target(s)):] Processing resource file "My Project\Resources.resx" into "obj\Deployment\MyTools.Resources.resources".
[10:46:19]:    [Project "MyTools.vbproj" (Rebuild target(s)):] Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
[10:46:19]:    [Project "MyTools.vbproj" (Rebuild target(s)):] C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Vbc.exe /noconfig /imports:Microsoft.VisualBasic,System,System.Collections,System.Collections.Generic,System.Data,System.Linq,System.Xml.Linq,System.Diagnostics,System.Collections.Specialized,System.Configuration,System.Text,System.Text.RegularExpressions,System.Web,System.Web.Caching,System.Web.SessionState,System.Web.Security,System.Web.Profile,System.Web.UI,System.Web.UI.WebControls,System.Web.UI.WebControls.WebParts,System.Web.UI.HtmlControls /optioncompare:Binary /optionexplicit+ /optionstrict:custom /optioninfer+ /nostdlib /rootnamespace:MyTools /sdkpath:C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319 /define:"CONFIG=\"Deployment\",_MyType=\"Custom\",PLATFORM=\"AnyCPU\"" /reference:D:\TeamCityBuildAgent\work\c18407eaf8486b52\MyTools\AutomatedFrontEndClasses\bin\Deployment\AutomatedFrontEndClasses.dll,D:\TeamCityBuildAgent\work\c18407eaf8486b52\MyLib\MyLib\bin\Deployment\MyLib.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Data.DataSetExtensions\v4.0_4.0.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Data.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Data.Linq.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.EnterpriseServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel\v4.0_4.0.0.0__b77a5c561934e089\System.ServiceModel.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Web.ApplicationServices\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.ApplicationServices.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.Web\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Web.DynamicData\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.DynamicData.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Web.Entity\v4.0_4.0.0.0__b77a5c561934e089\System.Web.Entity.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Web.Extensions\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.Extensions.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Web.Services\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll /out:obj\Deployment\MyTools.dll /resource:obj\Deployment\MyTools.Resources.resources /target:library ...(list o' source files)... "D:\TeamCityBuildAgent\temp\buildTmp\.NETFramework,Version=v4.0.AssemblyAttributes.vb"
[10:46:20]:    [Project "MyTools.vbproj" (Rebuild target(s)):] Copying file from "D:\TeamCityBuildAgent\work\c18407eaf8486b52\MyTools\AutomatedFrontEndClasses\bin\Deployment\AutomatedFrontEndClasses.dll" to "bin\AutomatedFrontEndClasses.dll".
[10:46:20]:    [Project "MyTools.vbproj" (Rebuild target(s)):] Copying file from "D:\TeamCityBuildAgent\work\c18407eaf8486b52\MyLib\MyLib\bin\Deployment\MyLib.dll" to "bin\MyLib.dll".
[10:46:20]:    [Project "MyTools.vbproj" (Rebuild target(s)):] Project "MyLib.vbproj" (GetCopyToOutputDirectoryItems target(s)):
[10:46:20]:    [Project "MyTools.vbproj" (Rebuild target(s)):] Project "AutomatedFrontEndClasses.vbproj" (GetCopyToOutputDirectoryItems target(s)):
[10:46:20]:    [Project "MyTools.vbproj" (Rebuild target(s)):] Copying file from "obj\Deployment\MyTools.dll" to "bin\MyTools.dll".
[10:46:20]:    [Project "MyTools.vbproj" (Rebuild target(s)):] MyTools -> D:\TeamCityBuildAgent\work\c18407eaf8486b52\MyTools\MyTools\bin\MyTools.dll
[10:46:20]:   [Project "MyTools.sln" (Rebuild target(s)):] Project "AutomatedFrontEndClasses.vbproj" (Rebuild target(s)):
[10:46:20]:   [Project "MyTools.sln" (Rebuild target(s)):] Project "MyLib.vbproj" (Rebuild target(s)):
[10:46:20]:   [Project "MyTools.sln" (Rebuild target(s)):] Project "MyTools.vbproj_deploy.wdproj.metaproj" (Rebuild target(s)):
[10:46:20]:    [Project "MyTools.vbproj_deploy.wdproj.metaproj" (Rebuild target(s)):] Project "MyTools.vbproj" (Rebuild target(s)):
[10:46:20]:    [Project "MyTools.vbproj_deploy.wdproj.metaproj" (Rebuild target(s)):] Project "MyTools.vbproj_deploy.wdproj" (Rebuild target(s)):
[10:46:20]:     [Project "MyTools.vbproj_deploy.wdproj" (Rebuild target(s)):] Creating directory "obj\Deployment\".
[10:46:20]:     [Project "MyTools.vbproj_deploy.wdproj" (Rebuild target(s)):] Project "MyTools.vbproj" (GetTargetPath target(s)):
[10:46:20]:     [Project "MyTools.vbproj_deploy.wdproj" (Rebuild target(s)):] Project "MyTools.vbproj" (GetNativeManifest target(s)):
[10:46:20]:     [Project "MyTools.vbproj_deploy.wdproj" (Rebuild target(s)):] C:\Program Files (x86)\MSBuild\Microsoft\WebDeployment\v10.0\Microsoft.WebDeployment.targets(1129, 5): warning MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.0" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.
[10:46:22]:     [Project "MyTools.vbproj_deploy.wdproj" (Rebuild target(s)):] Copying file from "C:\WINDOWS\assembly\GAC_64\System.Data.OracleClient\2.0.0.0__b77a5c561934e089\System.Data.OracleClient.dll" to "D:\TeamCityBuildAgent\work\c18407eaf8486b52\MyTools\MyTools\bin\System.Data.OracleClient.dll".
[10:46:22]:     [Project "MyTools.vbproj_deploy.wdproj" (Rebuild target(s)):] Copying file from "C:\WINDOWS\assembly\GAC_64\System.Transactions\2.0.0.0__b77a5c561934e089\System.Transactions.dll" to "D:\TeamCityBuildAgent\work\c18407eaf8486b52\MyTools\MyTools\bin\System.Transactions.dll".
[10:46:22]:     [Project "MyTools.vbproj_deploy.wdproj" (Rebuild target(s)):] Copying file from "C:\WINDOWS\assembly\GAC_64\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll" to "D:\TeamCityBuildAgent\work\c18407eaf8486b52\MyTools\MyTools\bin\System.EnterpriseServices.dll".
[10:46:22]:     [Project "MyTools.vbproj_deploy.wdproj" (Rebuild target(s)):] Copying file from "C:\WINDOWS\assembly\GAC_64\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.Wrapper.dll" to "D:\TeamCityBuildAgent\work\c18407eaf8486b52\MyTools\MyTools\bin\System.EnterpriseServices.Wrapper.dll".
[10:46:22]:     [Project "MyTools.vbproj_deploy.wdproj" (Rebuild target(s)):] C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe -v /MyTools.vbproj -p D:\TeamCityBuildAgent\work\c18407eaf8486b52\MyTools\MyTools -u -f -c obj\Deployment\TempBuildDir 
[10:46:26]:     [Project "MyTools.vbproj_deploy.wdproj" (Rebuild target(s)):] ASPNETCOMPILER error ASPCONFIG: Could not load file or assembly 'System.Data.OracleClient' or one of its dependencies. An attempt was made to load a program with an incorrect format.
[10:46:27]: MSBuild output:

[10:46:27]: "D:\TeamCityBuildAgent\work\c18407eaf8486b52\MyTools\MyTools.sln.teamcity.patch.tcprojx" (TeamCity_Generated_Build target) (1) ->
[10:46:27]: "D:\TeamCityBuildAgent\work\c18407eaf8486b52\MyTools\MyTools.sln" (Rebuild target) (2) ->
[10:46:27]: "D:\TeamCityBuildAgent\work\c18407eaf8486b52\MyTools\MyTools\MyTools.vbproj" (Rebuild target) (3) ->
[10:46:27]: "D:\TeamCityBuildAgent\work\c18407eaf8486b52\MyTools\AutomatedFrontEndClasses\AutomatedFrontEndClasses.vbproj" (default target) (5:2) ->
[10:46:27]: (GetReferenceAssemblyPaths target) -> 
[10:46:27]:   C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(847,9): warning MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.0" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend. [D:\TeamCityBuildAgent\work\c18407eaf8486b52\MyTools\AutomatedFrontEndClasses\AutomatedFrontEndClasses.vbproj]
[10:46:27]: "D:\TeamCityBuildAgent\work\c18407eaf8486b52\MyTools\MyTools.sln.teamcity.patch.tcprojx" (TeamCity_Generated_Build target) (1) ->
[10:46:27]: "D:\TeamCityBuildAgent\work\c18407eaf8486b52\MyTools\MyTools.sln" (Rebuild target) (2) ->
[10:46:27]: "D:\TeamCityBuildAgent\work\c18407eaf8486b52\MyTools\MyTools.vbproj_deploy\MyTools.vbproj_deploy.wdproj.metaproj" (Rebuild target) (6) ->
[10:46:27]: "D:\TeamCityBuildAgent\work\c18407eaf8486b52\MyTools\MyTools.vbproj_deploy\MyTools.vbproj_deploy.wdproj" (Rebuild target) (7) ->
[10:46:27]:   C:\Program Files (x86)\MSBuild\Microsoft\WebDeployment\v10.0\Microsoft.WebDeployment.targets(1129,5): warning MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.0" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend. [D:\TeamCityBuildAgent\work\c18407eaf8486b52\MyTools\MyTools.vbproj_deploy\MyTools.vbproj_deploy.wdproj]
[10:46:27]: "D:\TeamCityBuildAgent\work\c18407eaf8486b52\MyTools\MyTools.sln.teamcity.patch.tcprojx" (TeamCity_Generated_Build target) (1) ->
[10:46:27]: "D:\TeamCityBuildAgent\work\c18407eaf8486b52\MyTools\MyTools.sln" (Rebuild target) (2) ->
[10:46:27]: "D:\TeamCityBuildAgent\work\c18407eaf8486b52\MyTools\MyTools.vbproj_deploy\MyTools.vbproj_deploy.wdproj.metaproj" (Rebuild target) (6) ->
[10:46:27]: "D:\TeamCityBuildAgent\work\c18407eaf8486b52\MyTools\MyTools.vbproj_deploy\MyTools.vbproj_deploy.wdproj" (Rebuild target) (7) ->
[10:46:27]: (AspNetCompiler target) -> 
[10:46:27]:   ASPNETCOMPILER : error ASPCONFIG: Could not load file or assembly 'System.Data.OracleClient' or one of its dependencies. An attempt was made to load a program with an incorrect format. [D:\TeamCityBuildAgent\work\c18407eaf8486b52\MyTools\MyTools.vbproj_deploy\MyTools.vbproj_deploy.wdproj]
[10:46:27]:     33 Warning(s)
[10:46:27]:     1 Error(s)
[10:46:27]: Time Elapsed 00:00:21.56
[10:46:27]: Publishing artifacts
[10:46:27]:  [Publishing artifacts] Paths to publish: [teamcity-info.xml]
[10:46:27]:  [Publishing artifacts] Publishing files
[10:46:27]: Build finished

所以我发现我的设置有很多问题,但我想我已经解决了。据我所知,这一切都是由于在构建服务器上没有完全安装VisualStudio造成的

基本上,我缺少4.0框架的引用程序集,这导致MSBuild从GAC复制了一些程序集,以便可以使用它们。我的项目是32位的,但是机器是64位的,所以当它去获取程序集时,它抓取了64位的程序集,这导致了“不正确的格式”错误

通过安装完整的4.0SDK解决了这个问题后,我发现构建仍然无法工作,因为Web部署目标所期望的几个文件(因为它们随Visual Studio一起提供)实际上并不存在。我遵循了第三条评论中的建议:


从我的开发机器上复制过来的。web部署项目现在可以正常构建

在将项目从.Net4.0切换到.Net4.5后,我遇到了类似的错误。 TeamCity编译开始失败,并出现以下错误:

SGEN试图加载格式不正确的程序集:C:\Windows\Microsoft.Net\assembly\GAC\U 64\System.Data\v4.0\U 4.0.0\UU b77a5c561934e089\System.Data.dll

最后,我通过手动创建以下文件夹并复制其中缺少的DLL来解决此问题:
“c:\Program Files(x86)\Reference Assembly\Microsoft\Framework.NETFramework\v4.5\”

您只需确保您拥有用于您可能要目标版本的.NET Framework SDK(也称为目标软件包,aks开发者软件包)。它们可以在

正确的路径c:\Program Files(x86)\Reference Assembly\Microsoft\Framework\.NETFramework\v4.5\中找到并很好地枚举。我无法在Windows 8.1上安装v4.5,因为它说它已经包含在内,所以我最终将目录从我的电脑复制到服务器上,它最终为我解决了这个问题。谢谢你终于帮我弄清了真相!