【发布时间】:2021-03-16 15:08:55
【问题描述】:
我创建了一个基于 netstandard 2.0 的类库,并成功地将其包含在一个 droid 应用程序中。从 Visual Studio 调试时一切正常。我尝试使用dotnet 从命令行构建它,这就是发生奇怪事情的地方。构建运行良好,但在运行 dotnet pack 时,它说构建失败,出现 0 个错误和 0 个警告:
1:5>UnoResourcesGeneration:
Generating resources for platform :
Done executing task "ResourcesGenerationTask_v331aaa6f42492821058b51435a68065fe542d4fe" -- FAILED.
1:5>Done Building Project "....csproj" (_GetFrameworkAssemblyReferences target(s)) -- FAILED.
1>Done executing task "MSBuild" -- FAILED.
1>Done building target "_WalkEachTargetPerFramework" in project "....csproj" -- FAILED.
1>Done Building Project "....csproj" (pack target(s)) -- FAILED.
Build FAILED.
0 Warning(s)
0 Error(s)
这是使用 .NET 5 运行的,我尝试使用 .NET Core 2 对其进行编译,此外还会产生以下消息:
"....csproj" (pack target) (1) ->
(_UnoSourceGenerator target) ->
...\.nuget\packages\uno.sourcegenerationtasks\3.0.0\build\netstandard1.0\Uno.SourceGenerationTasks.targets(134,2): error MSB4062: The "Uno.SourceGeneratorTasks.SourceGenerationTask_v7422c41155a89db34b1e3241cd4c4761f2cabf5f" task could not be loaded from the assembly ...\.nuget\packages\uno.sourcegenerationtasks\3.0.0\build\netstandard1.0\..\Dev15.0\netcoreapp3.1\Uno.SourceGeneratorTasks.v7422c41155a89db34b1e3241cd4c4761f2cabf5f.dll. Could not load file or assembly 'System.Runtime, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. [....csproj]
(已删除路径)
谁能发现那里发生了什么?在 Visual Studio 中工作正常,但我需要能够从命令行构建它才能在 GitHub Actions 上设置构建。
【问题讨论】:
标签: uno-platform