Visual Studio 2017错误MSB3073:命令“" dotnet” exec

编程入门 行业动态 更新时间:2024-10-24 18:20:53
本文介绍了Visual Studio 2017错误MSB3073:命令“" dotnet” exec --runtimeconfig的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

您好

我正在使用Visual Studio 2017构建一个带有c#

应用程序执行OK但是在部署时我在日志文件中收到错误消息 ,在Web发布活动中窗口最后一行显示 (错误MSB3073:命令"" dotnet" exec --runtimeconfig ) 。

我想知道此错误消息的含义

问候

Dean

解决方案

你好Dean ,

欢迎来到MSDN论坛。

您的应用程序目标是 core 2吗?类似于 此问题。

通常, MSB3073表示构建事件中的命令出错。但是对于您的具体情况,似乎是 core 2.0 web-app的问题是由剃刀编译引起的。

请检查 doc :在调用关联的Razor Page或MVC视图时,在运行时编译Razor文件。不支持构建时Razor文件发布。剃刀文件可以选择在发布时编译,并使用预编译工具与应用程序一起部署。

我认为这是导致问题的原因: 在ASP.NET Core 2.0中执行自包含部署(SCD)时,Razor文件预编译不可用。

作为解决方法的解决方法这个:将< MvcRazorCompileOnPublish> false< / MvcRazorCompileOnPublish> 添加到您的xx.csproj文件中。 (将其添加到< PropertyGroup>)

希望它有所帮助。

最好的问候

Lance

Hi there

I am using Visual Studio 2017 building an ASP.core web application with c#

The application executes OK , however at deploy time I get an error message in a log file , in the Web Publish activity window the last line shows ( Error MSB3073: The command ""dotnet" exec --runtimeconfig ) .

I would like to know the meaning of this error message

Regards

Dean

解决方案

Hi Dean,

Welcome to MSDN forum.

Is your application target core 2? Something similar to this issue.

Usually, the MSB3073 indicates something is wrong with the command in build-events. But for your specific situation, it seems an issue with core 2.0 web-app which results from razor compilation.

Please check this doc: A Razor file is compiled at runtime, when the associated Razor Page or MVC view is invoked. Build-time Razor file publishing is unsupported. Razor files can optionally be compiled at publish time and deployed with the app—using the precompilation tool.

And I think this is the cause of your issue:Razor file precompilation is unavailable when performing a self-contained deployment (SCD) in ASP.NET Core 2.0.

As a workaround to solve this: Add<MvcRazorCompileOnPublish>false</MvcRazorCompileOnPublish> into your xx.csproj file. (Add it in a <PropertyGroup>)

Hope it helps.

Best Regards

Lance

更多推荐

Visual Studio 2017错误MSB3073:命令“&quot; dotnet” exec

本文发布于:2023-11-15 23:44:50,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1599031.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:命令   错误   Studio   Visual   dotnet

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!