0

私のチームは、2 つのプロジェクトを含む Visual Studio ソリューションを持っています。1 つは Umbraco Web サイト プロジェクトで、もう 1 つは Core という名前のデータ アクセス レイヤーです。Umbraco プロジェクトには、ビルド時の依存関係としてデータ アクセス レイヤーがあり、Umbraco プロジェクトは Azure Web サイトに発行されます。

Azure からダウンロードしてソリューションにインポートし、.pubxml 形式 (標準) として保存した発行プロファイルを使用しています。

Visual Studio 内で発行を行うと、Umbraco プロジェクトは Azure にデプロイする前に Core プロジェクトをビルドして .dll としてコンパイルします。これはうまくいきます。

ただし、このプロジェクトは、Visual Studio (sln) ビルド ステップを使用してビルドされたソリューションとの継続的な統合のために TeamCity を使用しています。2 番目の Core プロジェクトを導入する前は、正しくビルド/デプロイされていました。

依存関係として 2 番目の Core プロジェクトを作成して以来、ビルドは TeamCity のみで失敗するようになりました。Umbraco プロジェクト (デプロイしたいプロジェクト) にのみ保存した​​場合、両方のプロジェクトで発行プロファイルを検索しているように見えます。

問題がどこにあるのかわかりません。パブリッシュ プロファイルは、ビルド/コンパイルだけが必要な Core プロジェクトではなく、展開したい Umbraco プロジェクトにのみ適用する必要があります。

MSBuild 出力を含む TeamCity ビルド構成出力は次のとおりです。

[16:27:38] Checking for changes
[16:27:38] Collecting changes in 1 VCS root (1s)
[16:27:46] Building incremental patch for VCS root: Dev; checkout rules: =>; revision: 974f210ed3bdcb5b0f01cfd9f88fdd8335330cdd --> 974f210ed3bdcb5b0f01cfd9f88fdd8335330cdd
[16:27:41] Publishing internal artifacts
[16:27:41] Clearing temporary directory: C:\BuildAgent\temp\buildTmp
[16:27:41] Checkout directory: C:\BuildAgent\work\507e9be5fde8efc1
[16:27:41] Updating sources: server side checkout (5s)
[16:27:46] Step 1/4: Install NPM dependencies (Command Line) (1s)
[16:27:48] Step 2/4: Grunt tasks (Command Line) (3s)
[16:27:51] Step 3/4: Build solution and deploy (Visual Studio (sln)) (4s)
[16:27:52]   [Step 3/4] Starting: C:\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.MsBuildBootstrap.exe /workdir:C:\BuildAgent\work\507e9be5fde8efc1 "/msbuildPath:C:\Program Files (x86)\MSBuild\12.0\bin\MSBuild.exe"
[16:27:52]   [Step 3/4] in directory: C:\BuildAgent\work\507e9be5fde8efc1
[16:27:53]   [Step 3/4] Umbraco\Umbraco.csproj.teamcity: Build target: Build (2s)
[16:27:53]     [Umbraco\Umbraco.csproj.teamcity] CheckPrerequisites
[16:27:53]     [Umbraco\Umbraco.csproj.teamcity] RestorePackages
[16:27:54]     [Umbraco\Umbraco.csproj.teamcity] GetReferenceAssemblyPaths
[16:27:54]     [Umbraco\Umbraco.csproj.teamcity] ResolveProjectReferences (1s)
[16:27:54]       [ResolveProjectReferences] MSBuild (1s)
[16:27:54]         [MSBuild] Core\Core.csproj: Build default targets (1s)
[16:27:54]           [Core\Core.csproj] CheckPrerequisites
[16:27:54]           [Core\Core.csproj] RestorePackages
[16:27:54]           [Core\Core.csproj] GetReferenceAssemblyPaths
[16:27:54]           [Core\Core.csproj] ResolveAssemblyReferences
[16:27:55]           [Core\Core.csproj] CoreCompile
[16:27:55]           [Core\Core.csproj] _CopyAppConfigFile
[16:27:55]           [Core\Core.csproj] CopyFilesToOutputDirectory
[16:27:55]           [Core\Core.csproj] ValidatePublishProfileSettings
[16:27:55]             [ValidatePublishProfileSettings] GetPublishingLocalizedString
[16:27:55]             [ValidatePublishProfileSettings] GetPublishingLocalizedString
[16:27:55]               [GetPublishingLocalizedString] C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.targets(4331, 5): The value for PublishProfile is set to 'publish-profile-dev', expected to find the file at 'C:\BuildAgent\work\507e9be5fde8efc1\Core\Properties\PublishProfiles\publish-profile-dev.pubxml' but it could not be found.
[16:27:55]             [ValidatePublishProfileSettings] GetPublishingLocalizedString
[16:27:55]               [GetPublishingLocalizedString] C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.targets(4338, 4): PublishProfile(publish-profile-dev) is set. But the $(WebPublishMethod) does not have a valid value.  Current Value is "".
[16:27:55]             [ValidatePublishProfileSettings] Error
[16:27:55]               [Error] C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.targets(4345, 5): Target ValidatePublishProfileSettings Failed
[16:27:55]   [Step 3/4] Process exited with code 1
[16:27:55]   [Step 3/4] MSBuild output
[16:27:55]     [MSBuild output] (GetReferenceAssemblyPaths target) -> 
[16:27:55]     [MSBuild output]   C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(989,5): warning MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.5" 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. [C:\BuildAgent\work\507e9be5fde8efc1\Umbraco\Umbraco.csproj.teamcity]
[16:27:55]     [MSBuild output] 
[16:27:55]     [MSBuild output] 
[16:27:55]     [MSBuild output] "C:\BuildAgent\work\507e9be5fde8efc1\Umbraco\Umbraco.csproj.teamcity" (Build target) (1) ->
[16:27:55]     [MSBuild output] "C:\BuildAgent\work\507e9be5fde8efc1\Core\Core.csproj" (default target) (3) ->
[16:27:55]     [MSBuild output]   C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(989,5): warning MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.5" 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. [C:\BuildAgent\work\507e9be5fde8efc1\Core\Core.csproj]
[16:27:55]     [MSBuild output] 
[16:27:55]     [MSBuild output] 
[16:27:55]     [MSBuild output] "C:\BuildAgent\work\507e9be5fde8efc1\Umbraco\Umbraco.csproj.teamcity" (Build target) (1) ->
[16:27:55]     [MSBuild output] "C:\BuildAgent\work\507e9be5fde8efc1\Core\Core.csproj" (default target) (3) ->
[16:27:55]     [MSBuild output] (ResolveAssemblyReferences target) -> 
[16:27:55]     [MSBuild output]   C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1635,5): warning MSB3247: Found conflicts between different versions of the same dependent assembly. In Visual Studio, double-click this warning (or select it and press Enter) to fix the conflicts; otherwise, add the following binding redirects to the "runtime" node in the application configuration file: <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="System.Transactions" culture="neutral" publicKeyToken="b77a5c561934e089" /><bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" /></dependentAssembly></assemblyBinding><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="mscorlib" culture="neutral" publicKeyToken="b77a5c561934e089" /><bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" /></dependentAssembly></assemblyBinding><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="System" culture="neutral" publicKeyToken="b77a5c561934e089" /><bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" /></dependentAssembly></assemblyBinding><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="System.Data" culture="neutral" publicKeyToken="b77a5c561934e089" /><bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" /></dependentAssembly></assemblyBinding><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="System.Configuration" culture="neutral" publicKeyToken="b03f5f7f11d50a3a" /><bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" /></dependentAssembly></assemblyBinding><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="System.Net.Http" culture="neutral" publicKeyToken="b03f5f7f11d50a3a" /><bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" /></dependentAssembly></assemblyBinding><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="System.Web" culture="neutral" publicKeyToken="b03f5f7f11d50a3a" /><bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" /></dependentAssembly></assemblyBinding><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="System.Xml" culture="neutral" publicKeyToken="b77a5c561934e089" /><bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" /></dependentAssembly></assemblyBinding> [C:\BuildAgent\work\507e9be5fde8efc1\Core\Core.csproj]
[16:27:55]     [MSBuild output]   C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1635,5): warning MSB3270: There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "C:\Windows\Microsoft.NET\Framework\v4.0.30319\\mscorlib.dll", "x86". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project. [C:\BuildAgent\work\507e9be5fde8efc1\Core\Core.csproj]
[16:27:55]     [MSBuild output]   C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1635,5): warning MSB3270: There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "System.Data", "AMD64". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project. [C:\BuildAgent\work\507e9be5fde8efc1\Core\Core.csproj]
[16:27:55]     [MSBuild output]   C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1635,5): warning MSB3270: There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "System.EnterpriseServices", "AMD64". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project. [C:\BuildAgent\work\507e9be5fde8efc1\Core\Core.csproj]
[16:27:55]     [MSBuild output]   C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1635,5): warning MSB3270: There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "System.Web", "AMD64". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project. [C:\BuildAgent\work\507e9be5fde8efc1\Core\Core.csproj]
[16:27:55]     [MSBuild output] 
[16:27:55]     [MSBuild output] 
[16:27:55]     [MSBuild output] "C:\BuildAgent\work\507e9be5fde8efc1\Umbraco\Umbraco.csproj.teamcity" (Build target) (1) ->
[16:27:55]     [MSBuild output] "C:\BuildAgent\work\507e9be5fde8efc1\Core\Core.csproj" (default target) (3) ->
[16:27:55]     [MSBuild output] (ValidatePublishProfileSettings target) -> 
[16:27:55]     [MSBuild output]   C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.targets(4331,5): error : The value for PublishProfile is set to 'publish-profile-dev', expected to find the file at 'C:\BuildAgent\work\507e9be5fde8efc1\Core\Properties\PublishProfiles\publish-profile-dev.pubxml' but it could not be found. [C:\BuildAgent\work\507e9be5fde8efc1\Core\Core.csproj]
[16:27:55]     [MSBuild output]   C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.targets(4338,4): error : PublishProfile(publish-profile-dev) is set. But the $(WebPublishMethod) does not have a valid value.  Current Value is "". [C:\BuildAgent\work\507e9be5fde8efc1\Core\Core.csproj]
[16:27:55]     [MSBuild output]   C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.targets(4345,5): error : Target ValidatePublishProfileSettings Failed [C:\BuildAgent\work\507e9be5fde8efc1\Core\Core.csproj]
[16:27:55]     [MSBuild output] 
[16:27:55]     [MSBuild output]     7 Warning(s)
[16:27:55]     [MSBuild output]     3 Error(s)
[16:27:55]     [MSBuild output] 
[16:27:55]     [MSBuild output] Time Elapsed 00:00:02.37
[16:27:56]   [Step 3/4] Step Build solution and deploy (Visual Studio (sln)) failed
[16:27:56] Step 4/4: Fin. (Command Line)
[16:27:56] Publishing internal artifacts
[16:27:57] Build finished

これを修正する方法についてのアイデアはありますか?

編集: Visual Studio (sln) ビルド ステップに含まれるビルド パラメーターは次のとおりです。

DeployOnBuild       True
ExcludeFoldersFromDeployment        App_Data\Logs;App_Data\preview;Build
Password        biglongazurepasswordwhichiveobfuscated
ProfileTransformWebConfigEnabled        False
PublishProfile      publish-profile-dev
PublishProfileRootFolder        %teamcity.build.checkoutDir%\Umbraco\Properties\PublishProfiles
4

1 に答える 1