0

我有一个包含各种示例控制台应用程序项目的 Visual Studio 解决方案。其中之一是 MapsterSample,我在其中试用 Mapster,并按照 GitHub https://github.com/MapsterMapper/Mapster/wiki/Mapster.Tool上描述的步骤生成映射代码。

一切似乎都很好,除了我发出命令的部分:

dotnet msbuild -t:Mapster

即使在包管理器控制台中选择 MapsterSample 作为默认项目,这也会导致为解决方案中的每个项目执行命令:

SampleSolution\FirstSample\FirstSample.csproj : error MSB4057: The target "Mapster" does not exist in the project.
SampleSolution\SecondSample\SecondSample.csproj : error MSB4057: The target "Mapster" does not exist in the project.
... and so on

有没有办法只为 MapsterSample 项目执行命令?

4

1 回答 1

1

确保项目存在于您的解决方案中。

确保名称Mapster拼写正确。

确保您的终端位于正确的目录中。(理想情况下,您应该位于.csprojfor所在目录之上的目录Mapster中。

于 2021-05-14T05:27:39.897 回答