.net - 使用 NCrunch 时,为什么我收到 "ComputeBlazorBuildAssets"任务未给出所需参数 "DotNetJsVersion"的值?

标签 .net visual-studio blazor-webassembly ncrunch

NCrunch 无法编译这两个项目: enter image description here

由于同样的错误: enter image description here

Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets: enter image description here

Visual Studio 编译没有错误。 谢谢。

.net版本:7.0.400 Visual Studio 版本:17.7.2

我尝试从互联网下载该文件,但结果相同。 我尝试重新启动 NCrunch、重建解决方案等..

最佳答案

这个问题已在 NCrunch 论坛中得到解答,并提供官方支持。

雷姆科的回答是:

Try adding SelfContained=True for this project under your NCrunch 'Custom build properties' setting

这对我以及提出原始问题的人都有效。

以下是此设置所在位置的屏幕截图: enter image description here

完整答案,包括解释:

The problem is caused by a recent change in VS that causes Blazor WASM project builds to break whenever they are built with SelfContained=false. From what I understand, this type of project isn't something that MS want to support without it being run with a self contained publishing mode.

Under NCrunch, we force SelfContained=false because otherwise the build system slips an undeclared framework reference in that points to a platform target specific to this type of project. This causes problems with our ability to synchronise with grid nodes, as we need to know which packages are required by a project up-front before we try to build them on nodes.

Could you please try adding SelfContained=True for this project under your NCrunch 'Custom build properties' setting?

I hope that this will suppress the issue. If you're using distributed processing with this project, you'll need to perform a manual package restore on the remote nodes to make sure the required runtime pack is installed (the error will tip you off on this). If you're only running NCrunch locally, this shouldn't be an issue for you.

I'm submitting a fix to NCrunch to force SelfContained=true for Blazor WASM projects in future released builds.

关于.net - 使用 NCrunch 时,为什么我收到 "ComputeBlazorBuildAssets"任务未给出所需参数 "DotNetJsVersion"的值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/76980555/

相关文章:

visual-studio-2010 - 使用 VBA 和 Adob​​e PDF 阅读器控件复制选定的文本

javascript - 从 Blazor 调用 JavaScript : how to dispose JavaScript within DotNetObjectReference?

c# - 优雅地关闭系统托盘应用程序

c++ - 访问注册表数据以设置链接器和包含路径

c# - .NET/C# 与 Python 互操作

c++ - 获取未修改的非常量变量的警告

azure - 如何使用 Azure AD B2C 保护 Blazor Wasm 应用程序访问的 Azure Function 的安全?

blazor - 在 Blazor 应用程序中使用自定义 Razor 组件加载 JS 文件

c# - 对 WCF Web API 进行版本控制的最佳方式是什么?

.net - 无法加载文件或程序集 microsoft.sqlserver.sqlclrprovider 13.100.0.0