【问题标题】:How do I (re-)enable real-time CSS editing in Visual Studio?如何在 Visual Studio 中(重新)启用实时 CSS 编辑?
【发布时间】:2018-03-23 08:22:02
【问题描述】:

在 Visual Studio 2015 中:

  1. 创建一个新的空 C# ASP.NET Web 应用程序(框架 4.6)。
  2. 添加WebForm1.aspx:

    <%@ Page Language="C#" %>
    <!DOCTYPE html>
    <html>
    <head>
        <title></title>
        <link href="mycss.css" type="text/css" rel="stylesheet" />
    </head>
    <body>
        <div>Hello World</div>
    </body>
    </html>
    
  3. 添加mycss.css:

    div { color: red; }
    
  4. 右击WebForm1.aspx并选择“设为起始页”。

  5. 点击“运行”按钮,选择“Google Chrome”作为浏览器。
  6. 在 Visual Studio 中打开 mycss.css 并将 red 更改为 blue

请注意,在您完成输入 blue 的那一刻,Chrome 中的颜色会变为蓝色。无需在 Visual Studio 中保存,无需在 Chrome 中重新加载。这个feature is awesome

现在在 Visual Studio 2017 (15.3.5) 中执行相同的操作。什么都没发生。我必须保存 CSS 文件重新加载浏览器页面才能看到更改。

如何恢复该功能?这是一些配置选项吗?还是故意弃用的功能?还是错误?

【问题讨论】:

    标签: c# css asp.net google-chrome visual-studio-2017


    【解决方案1】:

    您正在寻找的功能称为浏览器链接,它是 Visual Studio 的一部分。确保该功能已启用并且“启用 CSS 自动同步”已打开。 See here for more info。此页面与 .Net Core 相关,但仍应与 WebForms 相关。

    【讨论】:

    • 谢谢,就是这样!在您知道它的正式名称之前,很难用谷歌搜索某些功能。
    • 我还必须关闭“在保存时启用重新加载”才能使我所做的更改变得流畅和实时。
    猜你喜欢
    • 2013-11-21
    • 2013-04-19
    • 2012-04-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-07-24
    相关资源
    最近更新 更多