【茶包射手日記】NuGet 封裝專案轉 Git 後無法編譯

栏目: ASP.NET · 发布时间: 6年前

内容简介:換用 Git 後踩到的第一個小坑,某個NuGet Packager 專案打包時發生錯誤,NuGet.log 顯示問題出在找不到 lib 資料夾:lib 本身是空資料夾,用於打包過程放入 DLL 與 PDB 檔案。專案在 TFVC 運作多年,搬到 Git 後才出錯。比對專案與實體資料夾,發現 lib、content、src 三個空資料夾不見了。

換用 Git 後踩到的第一個小坑,某個NuGet Packager 專案打包時發生錯誤,NuGet.log 顯示問題出在找不到 lib 資料夾:

[INFO] : NuGet Packager 2.0.3
[INFO] : Creating backup...
[INFO] : Renamed Epe.WebApi.Client.1.5.nupkg to Epe.WebApi.Client.1.5.nupkg.bak
[INFO] : Updating NuGet...
[INFO] : Checking for updates from https://nuget.org/api/v2/.
[INFO] : Currently running NuGet.exe 2.2.0.
[INFO] : Updating NuGet.exe to 5.0.2.
[INFO] : Creating package...
[INFO] : Attempting to build package from 'Package.nuspec'.
[ERROR] : 找不到路徑 'X:\GIT-SRC\CORE\Epe.WebApi.Client.NuGet\lib' 的一部分。
[INFO] : Exit Code: 1

lib 本身是空資料夾,用於打包過程放入 DLL 與 PDB 檔案。專案在 TFVC 運作多年,搬到 Git 後才出錯。

比對專案與實體資料夾,發現 lib、content、src 三個空資料夾不見了。

【茶包射手日記】NuGet 封裝專案轉 Git 後無法編譯

很快想起我的 Git 小抄有寫到:

空目錄不會被提交,解法為在目錄下放一個 .keep 或 .gitkeep 讓 Git 感應到它

TFVC 會將空資料夾簽入版控,但 Git 不會。解法很簡單,手動補建資料夾,用 touch .gitkeep 新增無內容空檔再 Commit,結束這回合。

A NuGet packager project failed to build after moved from TFVC to Git and I learned to add .gitkeep in empty folders to force Git commit them.


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Python for Everyone

Python for Everyone

Cay S. Horstmann、Rance D. Necaise / John Wiley & Sons / 2013-4-26 / GBP 181.99

Cay Horstmann's" Python for Everyone "provides readers with step-by-step guidance, a feature that is immensely helpful for building confidence and providing an outline for the task at hand. "Problem S......一起来看看 《Python for Everyone》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具