簡體   English   中英

通過電源在遠程服務器上運行(dotnet 測試命令)單元/集成測試 dll shell 需要 csproj 文件

[英]Running (dotnet test command) unit/integration tests dll on remote server through power shell requires csproj file

我將測試項目的 dll 部署到服務器。 現在我正在嘗試使用 dotnet test "Path to tests.dll" 運行它們,但出現錯誤:

F:\path\tests.dll(1,1): error MSB4025: The project file could not be loaded. Data at the root level is invalid. Line 1, position 1.

基本上,它要求 csproj 文件與我的本地計算機位於同一目錄中。 如果我仍然需要 csproj 在遠程服務器上運行測試,那么使用可運行的 DLL 進行測試有什么意義。 這沒有任何意義。

如何運行測試而不必在服務器上有 csproj 文件?

我找到了我的問題的答案。 為了通過 PowerShell 在遠程服務器上運行測試,我不得不使用“dotnet vstest”而不是“dotnet test”。 vstest 命令允許通過簡單地使用 dll 文件來運行測試,而無需 csproj 文件。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM