我不确定是否在正确的论坛(LightSwitch或TFS)中提交问题。在我的公司,我们有一个在Visual Studio 2012 LightSwitch和App.Server层开发的解决方案,我们使用ApplicationDataService.svc(OData)和WCF服务。我在TFS中创建了一个构建定义,以安排App的日常构建和发布。起初构建定义工作得很好,但由于某些原因,它会遇到一个错误,其日志结果显示如下:
PrepareForBuild:
Creando directorio "bin\Debug\".
LSSvcGenerators:
Quitando el directorio "C:\TFSAgent\_work\1\s\0-Development\OmniMerchant\OmniMerchant.Server\GeneratedArtifacts\GeneratedSvcFiles\".
Creando directorio "C:\TFSAgent\_work\1\s\0-Development\OmniMerchant\OmniMerchant.Server\GeneratedArtifacts\GeneratedSvcFiles\".
Generación completada
Copiando el archivo de "C:\TFSAgent\_work\1\s\0-Development\OmniMerchant\OmniMerchant.Server\GeneratedArtifacts\ApplicationData.svc" en "C:\TFSAgent\_work\1\s\0-Development\OmniMerchant\OmniMerchant.Server\GeneratedArtifacts\GeneratedSvcFiles\ApplicationData.svc".
Copiando el archivo de "C:\TFSAgent\_work\1\s\0-Development\OmniMerchant\OmniMerchant.Server\GeneratedArtifacts\AggregationsWCFServiceData.svc" en "C:\TFSAgent\_work\1\s\0-Development\OmniMerchant\OmniMerchant.Server\GeneratedArtifacts\GeneratedSvcFiles\AggregationsWCFServiceData.svc".
Copiando el archivo de "C:\TFSAgent\_work\1\s\0-Development\OmniMerchant\OmniMerchant.Server\GeneratedArtifacts\XtraReportsServiceData.svc" en "C:\TFSAgent\_work\1\s\0-Development\OmniMerchant\OmniMerchant.Server\GeneratedArtifacts\GeneratedSvcFiles\XtraReportsServiceData.svc".
Copiando el archivo de "C:\TFSAgent\_work\1\s\0-Development\OmniMerchant\OmniMerchant.Server\GeneratedArtifacts\OmniMembershipWCFData.svc" en "C:\TFSAgent\_work\1\s\0-Development\OmniMerchant\OmniMerchant.Server\GeneratedArtifacts\GeneratedSvcFiles\OmniMembershipWCFData.svc".
(Out) GeneratedSvcFiles: 'C:\TFSAgent\_work\1\s\0-Development\OmniMerchant\OmniMerchant.Server\GeneratedArtifacts\ApplicationData.svc;C:\TFSAgent\_work\1\s\0-Development\OmniMerchant\OmniMerchant.Server\GeneratedArtifacts\AggregationsWCFServiceData.svc;C:\TFSAgent\_work\1\s\0-Development\OmniMerchant\OmniMerchant.Server\GeneratedArtifacts\XtraReportsServiceData.svc;C:\TFSAgent\_work\1\s\0-Development\OmniMerchant\OmniMerchant.Server\GeneratedArtifacts\OmniMembershipWCFData.svc'
LSResourceGenerators:
Generación completada
(Out) GeneratedMetaDataFiles: 'C:\TFSAgent\_work\1\s\0-Development\OmniMerchant\OmniMerchant.Server\GeneratedArtifacts\ApplicationData.csdl;C:\TFSAgent\_work\1\s\0-Development\OmniMerchant\OmniMerchant.Server\GeneratedArtifacts\AggregationsWCFServiceData.csdl;C:\TFSAgent\_work\1\s\0-Development\OmniMerchant\OmniMerchant.Server\GeneratedArtifacts\XtraReportsServiceData.csdl;C:\TFSAgent\_work\1\s\0-Development\OmniMerchant\OmniMerchant.Server\GeneratedArtifacts\OmniMembershipWCFData.csdl;C:\TFSAgent\_work\1\s\0-Development\OmniMerchant\OmniMerchant.Server\GeneratedArtifacts\ApplicationData.msl;C:\TFSAgent\_work\1\s\0-Development\OmniMerchant\OmniMerchant.Server\GeneratedArtifacts\AggregationsWCFServiceData.msl;C:\TFSAgent\_work\1\s\0-Development\OmniMerchant\OmniMerchant.Server\GeneratedArtifacts\XtraReportsServiceData.msl;C:\TFSAgent\_work\1\s\0-Development\OmniMerchant\OmniMerchant.Server\GeneratedArtifacts\OmniMembershipWCFData.msl;C:\TFSAgent\_work\1\s\0-Development\OmniMerchant\OmniMerchant.Server\Gen...
CoreResGen:
"C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\resgen.exe" /useSourcePath /r:C:\TFSAgent\_work\1\s\0-Development\OmniSettlement\AggregationsWCFSer\bin\Debug\AggregationsWCFService.dll /r:"C:\Program Files (x86)\DevExpress\DXperience 12.2\Bin\Framework\DevExpress.Charts.v12.2.Core.dll" /r:"C:\Program Files (x86)\DevExpress\DXperience 12.2\Bin\Framework\DevExpress.Data.v12.2.dll" /r:"C:\Program Files (x86)\DevExpress\DXperience 12.2\Bin\Framework\DevExpress.Office.v12.2.Core.dll" /r:"C:\Program Files (x86)\DevExpress\DXperience 12.2\Bin\Framework\DevExpress.PivotGrid.v12.2.Core.dll" /r:"C:\Program Files (x86)\DevExpress\DXperience 12.2\Bin\Framework\DevExpress.Printing.v12.2.Core.dll" /r:"C:\Program Files (x86)\DevExpress\DXperience 12.2\Bin\Framework\DevExpress.RichEdit.v12.2.Core.dll" /r:"C:\Program Files (x86)\DevExpress\DXperience 12.2\Bin\Framework\DevExpress.Utils.v12.2.dll" /r:"C:\Program Files (x86)\DevExpress\DXperience 12.2\Bin\Framework\DevExpress.Xpf.Printing.v12.2.Cor...
Procesando archivo de recursos "rptMerchantTotals.resx" en "obj\Debug\LightSwitchApplication.rptMerchantTotals.resources".
Procesando archivo de recursos "rptRejectedTransactions.resx" en "obj\Debug\LightSwitchApplication.rptRejectedTransactions.resources".
CompileLicxFiles:
C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\LC.exe /target:Application.Server.dll /complist:Properties\licenses.licx /outdir:obj\Debug\ /i:C:\TFSAgent\_work\1\s\0-Development\OmniSettlement\AggregationsWCFSer\bin\Debug\AggregationsWCFService.dll /i:"C:\Program Files (x86)\DevExpress\DXperience 12.2\Bin\Framework\DevExpress.Charts.v12.2.Core.dll" /i:"C:\Program Files (x86)\DevExpress\DXperience 12.2\Bin\Framework\DevExpress.Data.v12.2.dll" /i:"C:\Program Files (x86)\DevExpress\DXperience 12.2\Bin\Framework\DevExpress.Office.v12.2.Core.dll" /i:"C:\Program Files (x86)\DevExpress\DXperience 12.2\Bin\Framework\DevExpress.PivotGrid.v12.2.Core.dll" /i:"C:\Program Files (x86)\DevExpress\DXperience 12.2\Bin\Framework\DevExpress.Printing.v12.2.Core.dll" /i:"C:\Program Files (x86)\DevExpress\DXperience 12.2\Bin\Framework\DevExpress.RichEdit.v12.2.Core.dll" /i:"C:\Program Files (x86)\DevExpress\DXperience 12.2\Bin\Framework\DevExpress.Utils.v12.2.dll" /i:"C:\Program Files (x86)\DevExpress...
GenerateTargetFrameworkMonikerAttribute:
Se omitirá el destino "GenerateTargetFrameworkMonikerAttribute" porque todos los archivos de salida están actualizados respecto a los archivos de entrada.
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\LightSwitch\v3.0\Microsoft.LightSwitch.Build.Tasks.targets(253,5): Error : Faltan los metadatos de DataService 'ApplicationData'.
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\LightSwitch\v3.0\Microsoft.LightSwitch.Build.Tasks.targets(253,5): error : Faltan los metadatos de DataService 'ApplicationData'. [C:\TFSAgent\_work\1\s\0-Development\OmniMerchant\OmniMerchant.Server\OmniMerchant.Server.csproj]
Generación completada
Compilación del proyecto terminada "C:\TFSAgent\_work\1\s\0-Development\OmniMerchant\OmniMerchant.Server\OmniMerchant.Server.csproj" (destinos predeterminados) -- ERROR.
Compilación del proyecto terminada "C:\TFSAgent\_work\1\s\0-Development\OmniMerchant\OmniMerchant.ls3proj" (destinos predeterminados) -- ERROR.
Compilación del proyecto terminada "C:\TFSAgent\_work\1\s\0-Development\OmniMerchant\OmniMerchant.sln" (destinos predeterminados) -- ERROR.
ERROR al compilar.
Looking at target file, specifically source line of error into
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\LightSwitch\v3.0\Microsoft.LightSwitch.Build.Tasks.targets(253,5):
<LSCodeGeneratorsTask Inputs="@(LightSwitchModel)"
ServiceModelFiles="@(ServiceMetadataFiles)"
IsRebuild="$(LSCodeGenFromRebuild)"
IsBuildingInsideVisualStudio="$(BuildingInsideVisualStudio)"
LightSwitchProjectType="$(LightSwitchProjectTypeV3)"
LightSwitchProjectSubType ="$(LightSwitchProjectSubType)"
ProjectPath="$(MSBuildProjectFullPath)"
Parameters="Language=$(Language)"
MetadataFiles="@(GeneratedMetadataFiles)"
ProjectOutputPath="$(OutDir)"
ExternalDataSources="@(ServerExternalDataSources)">
<Output ItemName="FileWrites"
TaskParameter="ModelChecksums" />
<Output ItemName="Compile"
TaskParameter="CodeFiles" />
<Output ItemName="GeneratedCodeFiles"
TaskParameter="CodeFiles" />
<Output ItemName="FileWrites"
TaskParameter="CodeFiles" />
</LSCodeGeneratorsTask>
但是,ApplicationData.csdl存在于GeneratedArtifacs中,所以我不明白为什么会导致错误。
请帮助,谢谢!
答案 0 :(得分:0)
我自己解决了。在LightSwitch VS2012中,OData服务使用者在服务器层项目中生成.edmx文件(实体框架数据模型)。我的项目中对此类服务(svc)的服务引用的名称是ApplicationData。由于.edmx文件被该项目中的其他人意外排除,Team Build无法找到ApplicationData模型,在之前提到的错误之前生成。我调整了这个,我将.edmx文件添加到TFS,一切正常!
感谢所有人和Cece。