在TFS 2017上建立一个净核心项目

时间:2017-07-05 15:27:58

标签: tfs .net-core tfs2017

我有一个包含30多个项目的解决方案,我正在尝试使用TFS2017构建过程构建。目前我正在遇到一些减速带。

项目是在VS2017的RTM版本中创建的,并且在开发机器上使用msbuild构建完全正常。我还在仅运行<TargetFrameworks />的机器之间转移了项目,以使所有依赖项工作。

对于没有&#39; stock&#39;的项目的唯一变化。是我使用csproj中的dotnet参数定位NET46和NETCORE。

以下是我为设置项目而设置TFS所采取的步骤。步骤4,5和6试图使其工作无济于事。

我经常提供的错误是TFS无法找到dotnet restore可执行文件,因为您可以在底部的日志输出中看到。

  1. 安装TFS 2017 - 这是2015年的升级
  2. 在构建服务器上安装VS 2017,确保已安装所有框架和编译器。
  3. 启动VS作为构建服务器帐户,并按照此处的建议(https://stackoverflow.com/a/38173701/2302383
  4. 创建和构建新的网络核心项目
  5. 设置此处描述的构建(https://www.visualstudio.com/en-us/docs/build/apps/aspnet/ci/build-aspnet-core)。
  6. 克隆适用于4.5.2的现有构建并添加dotnet restore命令。
  7. 使用Net Core预览构建模板创建构建。
  8. 步骤4的调试日志&amp; 5(使用带有2017-07-05T15:11:46.5154865Z ##[warning]File name doesn't indicate a full path to a executable file. 2017-07-05T15:11:46.5174870Z Executing the following command-line. (workingFolder = E:\VsoAgents\agent1\_work\31\s) 2017-07-05T15:11:46.5204867Z dotnet restore 2017-07-05T15:11:46.5214870Z Error message highlight pattern: 2017-07-05T15:11:46.5214870Z Warning message highlight pattern: 2017-07-05T15:11:46.5224872Z C:\Windows\system32\cmd.exe /c "dotnet restore" 2017-07-05T15:11:46.5624906Z 'dotnet' is not recognized as an internal or external command, 2017-07-05T15:11:46.5634910Z operable program or batch file. 的cmd任务)

    2017-07-05T15:15:37.1734770Z Set workingFolder to default: E:\VsoAgents\agent1\tasks\DotNetCoreCLI\0.3.1
    2017-07-05T15:15:37.7375119Z ##[debug]agent.workFolder=E:\VsoAgents\agent1\_work
    2017-07-05T15:15:37.7385124Z ##[debug]loading inputs and endpoints
    2017-07-05T15:15:37.7415122Z ##[debug]loading ENDPOINT_AUTH_$/
    2017-07-05T15:15:37.7455138Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_$/_ACCESSTOKEN
    2017-07-05T15:15:37.7465136Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
    2017-07-05T15:15:37.7475134Z ##[debug]loading ENDPOINT_AUTH_SCHEME_$/
    2017-07-05T15:15:37.7485123Z ##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
    2017-07-05T15:15:37.7495157Z ##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
    2017-07-05T15:15:37.7505131Z ##[debug]loading INPUT_COMMAND
    2017-07-05T15:15:37.7515125Z ##[debug]loading INPUT_PROJECTS
    2017-07-05T15:15:37.7525123Z ##[debug]loading INPUT_PUBLISHWEBPROJECTS
    2017-07-05T15:15:37.7535143Z ##[debug]loading INPUT_ZIPAFTERPUBLISH
    2017-07-05T15:15:37.7545134Z ##[debug]loaded 10
    2017-07-05T15:15:38.1705390Z ##[debug]command=restore
    2017-07-05T15:15:38.1715403Z ##[debug]projects=**/project.json
    2017-07-05T15:15:38.1725392Z ##[debug]arguments=null
    2017-07-05T15:15:38.1735387Z ##[debug]publishWebProjects=true
    2017-07-05T15:15:38.1745389Z ##[debug]zipAfterPublish=true
    2017-07-05T15:15:38.1755406Z ##[debug]check path : E:\VsoAgents\agent1\tasks\DotNetCoreCLI\0.3.1\task.json
    2017-07-05T15:15:38.1765390Z ##[debug]set resource file to: E:\VsoAgents\agent1\tasks\DotNetCoreCLI\0.3.1\task.json
    2017-07-05T15:15:38.1775415Z ##[debug]system.culture=en-US
    2017-07-05T15:15:38.1825417Z ##[debug]Absolute path for pathSegments: C:\Program Files\Python 3.5\Scripts\/dotnet = C:\Program Files\Python 3.5\Scripts\dotnet
    2017-07-05T15:15:38.1835414Z ##[debug]Absolute path for pathSegments: C:\Program Files\Python 3.5\/dotnet = C:\Program Files\Python 3.5\dotnet
    2017-07-05T15:15:38.1845418Z ##[debug]Absolute path for pathSegments: C:\Windows\system32/dotnet = C:\Windows\system32\dotnet
    2017-07-05T15:15:38.1855401Z ##[debug]Absolute path for pathSegments: C:\Windows/dotnet = C:\Windows\dotnet
    2017-07-05T15:15:38.1855401Z ##[debug]Absolute path for pathSegments: C:\Windows\System32\Wbem/dotnet = C:\Windows\System32\Wbem\dotnet
    2017-07-05T15:15:38.1865430Z ##[debug]Absolute path for pathSegments: C:\Windows\System32\WindowsPowerShell\v1.0\/dotnet = C:\Windows\System32\WindowsPowerShell\v1.0\dotnet
    2017-07-05T15:15:38.1875421Z ##[debug]Absolute path for pathSegments: %USERPROFILE%\.dnx\bin/dotnet = E:\VsoAgents\agent1\tasks\DotNetCoreCLI\0.3.1\%USERPROFILE%\.dnx\bin\dotnet
    2017-07-05T15:15:38.1885418Z ##[debug]Absolute path for pathSegments: C:\Program Files\Microsoft DNX\Dnvm\/dotnet = C:\Program Files\Microsoft DNX\Dnvm\dotnet
    2017-07-05T15:15:38.1895423Z ##[debug]Absolute path for pathSegments: C:\Program Files\Microsoft SQL Server\120\Tools\Binn\/dotnet = C:\Program Files\Microsoft SQL Server\120\Tools\Binn\dotnet
    2017-07-05T15:15:38.1905429Z ##[debug]Absolute path for pathSegments: C:\Program Files\Microsoft Office Servers\15.0\Bin\/dotnet = C:\Program Files\Microsoft Office Servers\15.0\Bin\dotnet
    2017-07-05T15:15:38.1915417Z ##[debug]Absolute path for pathSegments: C:\Program Files\Babel/dotnet = C:\Program Files\Babel\dotnet
    2017-07-05T15:15:38.1925419Z ##[debug]Absolute path for pathSegments: C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\/dotnet = C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\dotnet
    2017-07-05T15:15:38.1935419Z ##[debug]Absolute path for pathSegments: C:\Program Files\Microsoft SQL Server\110\Tools\Binn\/dotnet = C:\Program Files\Microsoft SQL Server\110\Tools\Binn\dotnet
    2017-07-05T15:15:38.1945409Z ##[debug]Absolute path for pathSegments: C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\/dotnet = C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\dotnet
    2017-07-05T15:15:38.1955423Z ##[debug]Absolute path for pathSegments: C:\Program Files\Microsoft\Web Platform Installer\/dotnet = C:\Program Files\Microsoft\Web Platform Installer\dotnet
    2017-07-05T15:15:38.1955423Z ##[debug]Absolute path for pathSegments: C:\Program Files (x86)\NuGet/dotnet = C:\Program Files (x86)\NuGet\dotnet
    2017-07-05T15:15:38.1965419Z ##[debug]Absolute path for pathSegments: C:\Program Files\Microsoft SQL Server\130\Tools\Binn\/dotnet = C:\Program Files\Microsoft SQL Server\130\Tools\Binn\dotnet
    2017-07-05T15:15:38.1975423Z ##[debug]Absolute path for pathSegments: C:\Users\[[REDACTED]]\.dnx\bin/dotnet = C:\Users\[[REDACTED]]\.dnx\bin\dotnet
    2017-07-05T15:15:38.1985426Z ##[debug]check path : null
    2017-07-05T15:15:38.2065429Z ##[debug]task result: Failed
    2017-07-05T15:15:38.2245432Z ##[error]Error: Failed which: Not found dotnet: null
    

    步骤6的调试日志(敏感信息已被[[删除]]替换)

    Dim Lastrowresults as integer
    Dim Counter as integer
    Dim Resultsheet as worksheet
    Dim rowcounter as integer
    
    Set resultsheet=sheets("Search Results")
    LastRowResults = ResultSheet.Range("A1").End(xlDown).Row
        For Counter = 3 To LastRowResults
          If ResultSheet.Range("I" & Counter).Value = "No" Then
             RowCounter = ResultSheet.Range("I" & Counter).Row
             Rows(RowCounter).EntireRow.Delete
         End If
        Next Counter 
    

1 个答案:

答案 0 :(得分:1)

代理在启动时扫描myObj1.someFunction() 和其他与环境相关的配置,因此您需要重新启动代理服务才能使与环境相关的更改生效。更完整的方法是重启机器,这将允许通过安装/更新组件进行的所有系统范围的更改生效。