简体   繁体   English

在Visual Studio 2013中使用带有Web Essentials的LESS和MVC5

[英]Using LESS with MVC5 in Visual Studio 2013 with Web Essentials

I have installed Visual Studio 2013 with Update 2 and installed Web Essentials. 我已经安装了Visual Studio 2013和Update 2并安装了Web Essentials。

I had thought this was going to make adding LESS to my views a piece of cake, but am missing something. 我原本以为这会让我的意见增加一点蛋糕,但我错过了一些东西。

The editor is great, and I imagine that it is compiling to css on save... 编辑很棒,我想它正在编译为css on save ...

But I don't know where the generated css is, and I don't have any clue as to how to get it reference in my view. 但是我不知道生成的css在哪里,我也没有任何关于如何在我看来引用它的线索。

I've tried a lot of searching, but can't get through the web of links about installing this and the features of that. 我已经尝试了很多搜索,但是无法通过网络链接来安装这个以及它的功能。

Any help at all will be greatly appreciated. 任何帮助都将非常感谢。

Thanks! 谢谢!

When you add a .less file and save, the Web Essentials will compile and generate the .css and .min.css files. 添加.less文件并保存时,Web Essentials将编译并生成.css和.min.css文件。 You will see an arrow in your solution explorer, or you can also confirm in your file system that the files are in the same folder. 您将在解决方案资源管理器中看到一个箭头,或者您也可以在文件系统中确认这些文件位于同一文件夹中。

Haven't used less with vs2013 but I have used sass and my guess would be the same. 与vs2013没有用得少,但我使用了sass,我的猜测是一样的。 By default the generated css gets generated in the same directory as the source (as it seemed to me) but you can check via tools>options>web essentials and there should be a set of options for less compile on save, build and directory to name but a few. 默认情况下,生成的css在与源相同的目录中生成(在我看来),但您可以通过工具>选项> web essentials进行检查,并且应该有一组选项,以便在save,build和directory上进行较少的编译。仅举几例。

If you right click on the solution there should be an option to create a web essentials settings file for the solution - these create and adds a json file of web essentials settings to the solution which means your settings are local to the solution which could be important if you are changing the output directory. 如果您右键单击解决方案,则应该有一个选项来为解决方案创建Web Essentials设置文件 - 这些创建并向解决方案添加web essentials设置的json文件,这意味着您的设置是解决方案的本地设置,这可能很重要如果要更改输出目录。

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

相关问题 Web Essentials浏览器链接在Visual Studio 2013中不起作用 - Web Essentials Browser Link not Work in Visual Studio 2013 引用在Visual Studio 2013中由Web Essentials缩小的文件 - Referencing files minified by Web Essentials in Visual Studio 2013 Windows 2012上的MVC5部署到IIS(Visual Studio 2013) - MVC5 Deploy to IIS on Windows 2012 (Visual Studio 2013) 如何在Visual Studio 2013 MVC5中包含简洁的Javascript - How to include Unobtrusive Javascript in Visual Studio 2013 MVC5 如何使用Web Essentials参数化较少的文件? - How to parameterize a less file using Web Essentials? 对于使用Web Essentials 2013(2.5.3)的ASP.Net MVC项目,如何配置LESS源映射以与Chrome一起使用? - How do I configure LESS source mapping to work with Chrome for a ASP.Net MVC project that uses Web Essentials 2013 (2.5.3)? 记录Visual Studio MVC5 - Logging Visual Studio MVC5 在Visual Studio 2013和ASP.NET MVC5中修改引导程序样式:这是一种合理的方法吗? - Modifying bootstrap styles in Visual Studio 2013 and ASP.NET MVC5: is this a reasonable approach? MVC5 Azure Active Directory基于角色的身份验证Visual Studio 2013 - MVC5 Azure Active Directory Role-Based Authentication Visual Studio 2013 来自教程连接字符串问题Visual Studio 2013的MVC5电影示例 - MVC5 Movie example from tutorial connection string issue visual studio 2013
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM