libgit2 / libgit2/libgit2sharp
System.Net.Http.dll 2.4.0.0 NotFound
還沒有人認領這個 Issue。
- 主要語言
- C#
- 星號
- 3.5k
- 分支
- 925
- PR 合併指標
- 30 天內沒有已合併 PR
描述
Reproduction steps
- Create a new blank WebAPI project. Note under references the System.Net.Http reference version is 4.0.0.0
- install any version of LibGet2Sharp (any version after 0.24.1) and note that the new System.Net.Http dll is now version 4.2.0.0
- add a new ms test project, and attempt to write a test against anything that requires use of a
RequestMessageResult. E.G: the following for example:
[TestMethod]
public async Task ResponseShouldRenderCorrectly()
{
var moq = new Mock<IGitHubRepository>();
var target = new Target(moq.Object);
var dto = new DTO
{
SomeField = "Nate Was Here"
};
var actualResponse = target.StatusCode(System.Net.HttpStatusCode.OK, dto);
Assert.IsNotNull(actualResponse);
Assert.IsInstanceOfType(actualResponse, typeof(ResponseMessageResult));
var strResponse = actualResponse as ResponseMessageResult;
Assert.AreEqual(System.Net.HttpStatusCode.OK, strResponse.Response.StatusCode);
var actual = await strResponse?.Response?.Content.ReadAsStringAsync();
var expected = "{\"SomeField\":\"Nate Was Here\"}";
Assert.AreEqual(expected, actual);
}
Expected behavior
I should be able to run the test code above to work, and i should be able to debug into the Target class used in the test.
Actual behavior
I receive a FileNotFound when looking for the System.Net.Http.dll with version 4.2.0.0 which it looks for in the BuildExtensions. That file is not reachable in my class library with my test, which is referencing the webapi project i created.
Version of LibGit2Sharp (release number or SHA1)
Version 0.42.1 works, but 0.25.0 and 0.25.2 are both causing this type of un-testable code.
Operating system(s) tested; .NET runtime tested
Windows 10, .net 4.6.1 run time.
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
使用 issue 中描述的空白 WebAPI 專案、LibGit2Sharp 0.25.x 以及新增的 MSTest 專案重現此失敗。首先檢查如何從 BuildExtensions 解析 System.Net.Http.dll 版本 4.2.0.0,並將其與 0.24.1 或 0.42.1 的正常行為進行比較;當範例測試可以執行,且可以在不出現 FileNotFound 錯誤的情況下對參考的 Target 類別進行偵錯時,即表示完成。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- csharp
- 領域
- backend, build-system
- Issue 類型
- 缺陷
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100