Visual Studio 2017错误MSB3073:命令“" dotnet” exec --runtimeconfig [英] Visual Studio 2017 Error MSB3073: The command ""dotnet" exec --runtimeconfig

查看:669
本文介绍了Visual Studio 2017错误MSB3073:命令“" dotnet” exec --runtimeconfig的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好



 我正在使用Visual Studio 2017构建一个带有c#  <的ASP.core Web应用程序/ p>

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


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


问候 


Dean 



解决方案

你好Dean ,


欢迎来到MSDN论坛。


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


通常, MSB3073表示构建事件中的命令出错。但是对于您的具体情况,似乎是.net 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 .net 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 .net 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 --runtimeconfig的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆