1

Согласно NuGet Documentation, NuGet пакет восстановления должен «просто работать» с TFS 2013.TFS 2013 Не Восстановление NuGet пакетов

Это не так.

При запуске сборки машины, он дает мне следующую ошибку (где он не может найти Newtonsoft.Json)

Program.cs (5): The type or namespace name 'Newtonsoft' could not be found (are you missing a using directive or an assembly reference?) 

Это с совершенно новым проектом, на TFS 2013 с использованием шаблона по умолчанию (TfvcTemplate.12.xaml). Я использую VS 2013. Честно говоря, я новичок в TFS, так что я не уверен, что журнал сборки должен выглядеть, но мое выглядит следующим образом:

Overall Build Process 
Overall build process 
Update build number 
Run on agent (reserved build agent CTIDEV2k8 - Agent1) 
Initialize environment 
Get sources from Team Foundation Version Control 
Associate the changesets that occurred since the last good build 
Compile, Test and Publish 
Run optional script before MSBuild 
Run MSBuild 
Built $/Web/TestApp/TestApp.sln for default targets. 
Built $/Web/TestApp/TestApp/TestApp.csproj for default targets. 
C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Microsoft.Common.CurrentVersion.targets (1697): Could not resolve this reference. Could not locate the assembly "Newtonsoft.Json". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. 
Program.cs (5): The type or namespace name 'Newtonsoft' could not be found (are you missing a using directive or an assembly reference?) 
MSBuild Log File 
Exception Message: MSBuild error 1 has ended this build. You can find more specific information about the cause of this error in above messages. (type BuildProcessTerminateException) 
Exception Stack Trace: at System.Activities.Statements.Throw.Execute(CodeActivityContext context) 
    at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) 
    at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation) 
Handle Exception 
Create a bug for the build failure 
Rethrow the exception so the build will stop 
Perform Final Actions On Agent 
Copy binaries to drop 
Reset the Environment 
Work item '96: Build Failure in Build: TestApp2_20150224.2' was opened by the build. 

кто-нибудь об этом знает ?

+2

Это на строительной машине? Если да, у вас есть Visual Studio на этой машине? –

+0

@BuckHodges: Да и да. – Pharylon

ответ

1

Проблема оказалась в том, что мы имели внутренний канал пакета NuGet. Проблема была исправлена ​​добавлением файла nuget.config в корень папки решения:

<?xml version="1.0" encoding="utf-8"?> 
<configuration> 
    <packageRestore> 
    <add key="enabled" value="True" /> 
    </packageRestore> 
    <packageSources> 
    <add key="nuget.org" value="https://www.nuget.org/api/v2/" /> 
    <add key="InternalFeed" value="https://our.nuget.com" /> 
    </packageSources> 
    <activePackageSource> 
    <add key="nuget.org" value="https://www.nuget.org/api/v2/" /> 
    </activePackageSource> 
</configuration> 
0

Вы уверены, что восстановление пакета включено в Visual Studio на сервере сборки? Сервер сборки может достигать nuget.org? Вы можете открыть TestApp.sln на своем сервере сборки и попытаться скомпилировать его вручную. Это работает?

Enable Package Restore

+0

Да, восстановление включено на сервере, и при открытии решения в VS на сервере он восстанавливает пакет и компилирует. – Pharylon

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