简体   繁体   English

为什么 Visual Studio 2019 会删除对新 .razor 文件的监视?

[英]Why does Visual Studio 2019 remove watch for new .razor files?

In Visual Studio Professional 2019 v 16.8, in my Blazor client's .csproj file, I have a line inside an ItemGroup:在 Visual Studio Professional 2019 v 16.8 中,在我的 Blazor 客户端的 .csproj 文件中,我在 ItemGroup 中有一行:

<Watch Include="**\*.razor;**\appsettings.*" />

That way, whenever I change a .razor file, dotnet watch run will rebuild and restart the web server automatically.这样,每当我更改 .razor 文件时, dotnet watch run都会自动重建并重新启动 Web 服务器。 Great.伟大的。

But now, whenever I create a .razor file in the project (such as Foo.razor), Visual Studio quite unhelpfully adds a "remove" line, such as:但是现在,每当我在项目中创建 .razor 文件(例如 Foo.razor)时,Visual Studio 都会毫无帮助地添加一个“删除”行,例如:

<Watch Remove="Components\Widgets\Foo.razor" />

It also adds this, sometimes:它还添加了这一点,有时:

<Content Remove="Components\Widgets\Foo.razor" />

I then have to manually edit the csproj file to remove these lines.然后我必须手动编辑 csproj 文件以删除这些行。 Why is it doing this, and how can I turn it off?为什么会这样,我该如何关闭它? Or is there something bigger that is wrong here?或者这里有什么更大的问题? Some searching found no one else dealing with this;一些搜索发现没有其他人处理这个问题; maybe I have something wrong with my setup?也许我的设置有问题?

(I saw exactly the same behavior in earlier versions.) Thanks in advance. (我在早期版本中看到了完全相同的行为。)提前致谢。

我已经报告了这个问题,应该在某个时候解决: https : //github.com/dotnet/aspnetcore/issues/27718

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Visual Studio 2019 观察 Window:IntelliSense 完成 - Visual Studio 2019 Watch Window: IntelliSense Completion 如何在 Visual Studio 2019 中打开手表 Window - How to open the Watch Window in Visual Studio 2019 Visual Studio 2019 无法识别从 GitHub 提取的新文件 - Visual Studio 2019 not Recognizing new Files Pulled from GitHub Visual Studio Community 2019 16.5.3 与 Blazor 应用程序 -&gt; 添加 -&gt; 新项目 -&gt; Razor 组件 -&gt; 路由或组件未呈现 - Visual Studio Community 2019 16.5.3 with Blazor App -> Add -> New Item -> Razor Component -> Route or component is not rendered 删除和排序使用在 Visual Studio 2019 中不起作用 - Remove and Sort Usings not working in Visual Studio 2019 Visual Studio 2019 通过单击删除即时突出显示 - Visual Studio 2019 Remove instant highlighting by clicking 为什么 Visual Studio 会突出显示 Razor (.cshtml/.razor) 中的双花括号? - Why does Visual Studio highlight double curly braces in Razor (.cshtml/.razor)? 删除 Visual Studio 2019 上的 Source Map 部分 - Remove Source Map section on Visual Studio 2019 Visual Studio 2019 Razor 语法在使用本地函数时突出显示 - Visual Studio 2019 Razor Syntax Highlighting When Using Local Functions 在Visual Studio 2019中的发布中未编译某些Razor视图 - Some Razor Views are not Being Compiled on Publish in Visual Studio 2019
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM