如何在Visual Studio中(重新)启用实时CSS编辑? [英] How do I (re-)enable real-time CSS editing in Visual Studio?

查看:202
本文介绍了如何在Visual Studio中(重新)启用实时CSS编辑?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Visual Studio 2015中:

In 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>

  • 添加mycss.css:

    div { color: red; }
    

  • 右键单击WebForm1.aspx并选择设置为起始页".

  • Right-click on WebForm1.aspx and choose "Set As Start Page".

    请注意,完成键入blue 的那一刻,Chrome中的颜色将变为蓝色.无需在Visual Studio中进行保存,无需在Chrome中重新加载. 功能很棒

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

    Now do the same in Visual Studio 2017 (15.3.5). Nothing happens. I have to save the CSS file and reload the browser page to see the change.

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

    How do I get that feature back? Is this some configuration option? Or a deliberately deprecated feature? Or a bug?

    推荐答案

    您要查找的功能称为浏览器链接,它是Visual Studio的一部分.确保已启用该功能,并且已启用启用CSS自动同步". 在此处查看更多信息.该页面与.Net Core有关,但仍应与WebForms相关.

    The feature you're looking for is called Browser Link and is part of Visual Studio. Make sure the feature is enabled and that "Enable CSS Auto-Sync" is turned on. See here for more info. This page relates to .Net Core, but should still be relevant for WebForms.

    这篇关于如何在Visual Studio中(重新)启用实时CSS编辑?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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