Dotlesscss @import 语句:找不到文件。使用梳子

发布于 2025-01-06 17:30:33 字数 609 浏览 0 评论 0原文

在 asp.net mvc 3 项目中,我使用 Combres 来组合和缩小我的 CSS 文件。我正在使用 dotlesscss 过滤器来获取精美的 css 附加内容,例如变量。

但是,当我尝试使用 dotlesscss @import 语句 (请参阅页面底部的导入), css 生成失败并出现以下错误:

Could not find a part of the path 'C:\Program Files (x86)\IIS Express\colors.less'.

很明显,无点编译器正在错误的目录中查找,但是:如何修复此问题?

[编辑]:根据要求:我尝试了以下语法:

@import "Colors.less"
@import "~/Content/Colors.less"

In an asp.net mvc 3 project, i'm using Combres to combine and minify my CSS files. I'm using the dotlesscss filter for fancy css extras such as variables.

However, when i try to use the dotlesscss @import statement (see importing at bottom of page), css generation failes with the following error:

Could not find a part of the path 'C:\Program Files (x86)\IIS Express\colors.less'.

It's clear that the dotless compiler is looking in the wrong directory, however: how to fix this?

[edit]: as requested: i tried the following synaxes:

@import "Colors.less"
@import "~/Content/Colors.less"

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

海螺姑娘 2025-01-13 17:30:33

使用 DotlessCssCombineFilter 而不是 DotlessCssFilter。然后从 *.less 文件中删除 @import 语句,并在 resourceSet 中按正确的顺序导入 *.less 文件。

Use the DotlessCssCombineFilter instead of the DotlessCssFilter. Then remove the @import statements from your *.less files, and instead import the *.less files in the right order inside the resourceSet.

吖咩 2025-01-13 17:30:33

接受的答案是一种变通方法,而不是解决方案。

这是问题的修复,这是给 Combres 团队的建议

The accepted answer is a work around, not a fix.

Here is the fix to the issue and here is the suggestion to the Combres team.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文