[英]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.