В сборке TFS периодически отсутствуют файлы .targets

Наши сборки не работают на сервере сборки TFS, время от времени возникают одни и те же ошибки.

Я получаю это сообщение в одном из наших проектов (ошибка относится к проекту WebApi):

Импортированный проект «C: \ Program Files (x86) \ MSBuild \ 12.0 \ bin \ Microsoft.CompactFramework.CSharp.targets» не найден. Убедитесь, что путь в объявлении правильный, и что файл существует на диске.

И этот в другом проекте (в проектах смарт-устройств):

Импортированный проект «C: \ Program Files (x86) \ MSBuild \ Microsoft \ VisualStudio \ v12.0 \ WebApplications \ Microsoft.WebApplication.targets» не найден. Убедитесь, что путь в объявлении правильный, и что файл существует на диске.

Обычно это означает, что файла нет, и нужно либо установить инструмент, содержащий целевые файлы, либо вручную скопировать их с машины разработчика. Я видел это раньше в той ситуации и легко решил, поскольку это тривиальная проблема.

Проблема в том, что файлы там! Сборки кажутся случайными, что для меня крайне непонятно. Если мы выберем «Повторить сборку» несколько раз, сборка пройдет нормально. Иногда сборка просто работает в первый раз, а затем начинает показывать эту ошибку. Мне не удалось обнаружить никаких закономерностей относительно того, когда это произойдет.

В самих файлах нет абсолютно ничего особенного. Я думал, что им почему-то не хватает некоторых разрешений, но у них те же настройки безопасности, что и у других сопутствующих файлов.

Я даже не знаю, что здесь исследовать. В сообщении указывается, что файл отсутствует, но файл есть. Тот факт, что это происходит с перерывами, еще более проблематичен.

Это происходит на машине сборки TFS 2013. Visual Studio 2013 Ultimate был установлен на нем после установки TFS. У нас есть еще одна виртуальная машина сборки в компании, использующая TFS2012, и я никогда не видел такого странного поведения.

РЕДАКТИРОВАТЬ:

Я забыл упомянуть об этом, но есть также куча случайных предупреждений о сборке, содержащей веб-проект. Они появляются только при возникновении ошибки в файле .targets и не отображаются в другой сборке. Возможно, это связано с тем, что один - это .Net4.5 (веб), а другой - .Net3.5cf:

 C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets (989): 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:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets (989): 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:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets (1635): 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:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets (1635): 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:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets (989): 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:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets (1635): 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:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets (1635): 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:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets (989): 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.

РЕДАКТИРОВАТЬ 2:

Ok. После комментария Дилана я зашел в журналы сборки, чтобы «подтвердить», что сборки выполнял только один агент, и, к моему удивлению:

Successful Build: Run on agent (reserved build agent Build2014 - Agent1)
Failed Build: Run on agent (reserved build agent TFS2013 - Agent1)

Build2014 - это наша виртуальная машина сборки, а TFS2013 - наша система управления версиями.

Когда TFS 2013 был установлен на TFS2013, вместе с ним на том же компьютере был установлен агент сборки. Контроллер, установленный на отдельной машине, также имел одноименный агент. Это означает, что контроллер выбирал один из них, и всякий раз, когда они попадали на машину TFS, сборка терпела неудачу (потому что там специально нет среды разработки).

Удалите неправильно установленный агент на машине TFS.


person julealgon    schedule 25.03.2014    source источник


Ответы (1)


Вы уверены, что ваши сборки всегда работают на одном агенте / сервере сборки? Возможно ли, что у вас установлено несколько агентов сборки, и они работают только с определенными?

person Dylan Smith    schedule 25.03.2014
comment
да. Я абсолютно уверен, что они работают на одном агенте, контроллере и машине ... - person julealgon; 25.03.2014
comment
Хорошо ... забудьте об этом, вы правы. На одном контроллере зарегистрировано два агента с одинаковым именем на разных машинах. Невероятный. - person julealgon; 25.03.2014