[NUGET] error NU1101 + warning NU1801 ตอน Build ผ่าน Jenkins Windows Service

หลังจากผูก Service กับด้วยวิธีการ Manual เขียน Batch ครอบ แล้วเอาไปรันเอง มาลองทำ Windows Service ตามเครื่องมีที่ Jenkins ให้มาเลย พอลอง Run ปุ๊บบบ Error

C:\Users\invest\.jenkins\workspace\INVEST_WEBAPI\WebApi\WebApi.csproj : error NU1101: Unable to find package Slf4Net.Log4Net. No packages exist with this id in source(s): 
http://dev-dr.local:8081/repository/nuget-group/index.json, http://dev.local:8081/repository/nuget-group/index.json, nuget.org [C:\Users\invest\.jenkins\workspace\INVEST_WEBAPI\InvWebAPIStandard.sln]
C:\Users\invest\.jenkins\workspace\INVEST_WEBAPI\WebApi\WebApi.csproj : error NU1101: Unable to find package ds.Service.Proxy. No packages exist with this id in source(s): 
http://dev-dr.local:8081/repository/nuget-group/index.json, http://dev.local:8081/repository/nuget-group/index.json, nuget.org [C:\Users\invest\.jenkins\workspace\INVEST_WEBAPI\InvWebAPIStandard.sln]
  Failed to restore C:\Users\invest\.jenkins\workspace\INVEST_WEBAPI\WebApi\WebApi.csproj (in 53.41 sec).

C:\Users\invest\.jenkins\workspace\INVEST_WEBAPI\InvestWebApi\InvestWebApi.csproj : warning NU1801: Unable to load the service index for source http://dev-dr.local:8081/repository/nuget-group/index.json. 
[C:\Users\invest\.jenkins\workspace\INVEST_WEBAPI\InvWebAPIStandard.sln]
C:\Users\invest\.jenkins\workspace\INVEST_WEBAPI\InvestWebApi\InvestWebApi.csproj : warning NU1801: Unable to load the service index for source http://dev.local:8081/repository/nuget-group/index.json. 
[C:\Users\invest\.jenkins\workspace\INVEST_WEBAPI\InvWebAPIStandard.sln]

Solution

  • แก้ไขตัว Service Jenkins ไม่ให้ Local System จัดการ แต่ใช้ User ที่ใช้งานกัน อาจจะสร้าง Jenkins ขึ้นมาสำหรับจัดการกับ Jenkins เช่น JenkinsAdm
  • แต่ถ้าหากต้องให้ Local System จัดการ ต้องเพิ่ม nuget.config ใน solution ที่ต้องการ Run แทน

Reference


Discover more from naiwaen@DebuggingSoft

Subscribe to get the latest posts to your email.