2015-03-12 2 views
0

У моей команды есть решение Visual Studio с двумя проектами в нем - 1 - проект веб-сайта Umbraco, другой - доступ к данным слой с именем Core. Проект Umbraco имеет уровень доступа к данным как зависимость во время сборки, а проект Umbraco публикуется на веб-сайте Azure.Решение VS, развертывающееся на Azure через TeamCity, терпит неудачу с «отсутствием». Публикация профиля в обоих проектах решения.

Мы используем публикации, загруженные с Azure и импортированные в решение, и сохраняемые как .pubxml формат - стандарт.

Когда мы публикуем внутри Visual Studio, проект Umbraco строит и компилирует проект Core как .dll перед его развертыванием в Azure. Это прекрасно работает.

Однако этот проект использует TeamCity для непрерывной интеграции с решением, построенным с использованием этапа сборки Visual Studio (sln). Прежде чем мы представили второй проект Core, он правильно строил/развертывал.

С момента создания второго проекта Core в качестве зависимости, теперь сборка завершается с ошибкой только в TeamCity. Похоже, что поиск профиля публикации в как проектов, когда мы только сохранили его в проекте Umbraco (тот, который мы хотим развернуть).

Я не уверен, где находится проблема. Мы хотим, чтобы профиль публикации применялся к проекту Umbraco, который мы хотим развернуть, а не к Core, который просто требует сборки/компиляции.

Вот вывод конфигурации TeamCity сборки, включая вывод MSBuild:

[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 

Любые идеи о том, как я могу это исправить?

Edit: Вот параметры сборки, включенные в 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 

ответ

0

Очень простое исправление нашли для этого. Основной проект был добавлен как веб-приложение в Visual Studio, а не в библиотеку классов. Поэтому он всегда собирался попытаться опубликовать его.

Фактическое исправление заключалось в обновлении идентификатора GUID в файле Core.csproj в соответствии с https://stackoverflow.com/a/10878686/4498130

Смежные вопросы