VS 2012 Web Essentials Less Compile Error - css

Visual Studio 2012 Update 2
Web Essentials 2.7
Hello,
Every time when I try to change or create any .less file, I got this message in css preview:
/*
Compile Error.
See error list for details
*/
And when I open Error List, I can see this:
LESS:
This thing same everytime, no description at all. It doesn't depend from code, even this code generate error:
body {
}
What shall I do?

I've been having this issue with Web essentials 2.7 and I still have it with v 3.2. Error message now reads as "LESS: Unrecognised input".
The only way I could get rid off this issue is to save main less file and all imported less files with encoding "UTF-8 without encoding" (File save, open Save As to find this option).
That's strange because Web essentials long time ago told BOM file markers bug was fixed. Also some other guys with same version of Web essentials do not have this issue using the same files.
So try for yourself, maybe it can help.

Look at this:Web Essentials LESS Compiler gives no Error Messages
try to uninstalled Web Essentials, then re-installed them.

Try to add this to the start of your less file:
*{}

Placing #import at the end of my main.less file helped with Compile Error issue.
body{
background:#bcg-main;
}
#import url('less/variables.less');

It happened to me before. I have to add in my .less files one by one to determine which file breaks the compilation. Then I can look into the file in suspicion and remove the bug.

Related

Visual Studio CSS not working in compiled app

I am new to Visual Studio 2019 and I am having a bit of a problem with my CSS stylesheet location. I am using the Peachpie.App NuGet and everything works perfectly when I run the Debug (F5) with the correct stylesheet being used but if I run the compiled application executable I loose all of the CSS formatting. I assume I have got the style.css file in the wrong location for the compiling process to pick it up but I don't know how to resolve that, can anyone provide some advice on this?
Thanks,
Gerry
I manually copied the style.css file to the "\bin\Release\net5.0\wwwroot" directory and it resolved the problem but I should have expected that that would have been down during the Build process.

Non-project files with ReSharper (SASS)

I'm running JetBrains ReSharper 8.2 on a project that uses SASS for styling.
I compile my seperate scss files into one file "common.css". This file is not included in the project, but gets compiled on build on the server (grunt + compass takes care of this).
I don't want to include this file, but only my SCSS files in the project. This however causes ReSharper to report a lot of errors ("Unknown CSS class"...) in my views because the file isn't included.
Is there a workaround for this (without disabling css errors in settings)?
I've tried the "ReSharper.ExternalCode" extension (https://resharper-plugins.jetbrains.com/packages/ReSharper.ExternalCode), but without any luck.
Sadly, there isn't a workaround for this. ReSharper doesn't know about SCSS files, and doesn't know anything about files that aren't included in the project, so it can only assume the CSS classes are undefined.
The external code plugin should work and allow ReSharper to process the resulting css file. However, I'm not sure how flexible it is - I think it needs everything to be configured before the solution is opened. That is, it only tells ReSharper about the generated file when the solution is being opened. Configuring things while a solution is open probably won't be reflected immediately (but I haven't tried it). Similarly, it doesn't notify ReSharper of changes to the file, and I don't think that ReSharper sets up any monitoring. So if the file isn't available when the solution opens, or changes while it's open, ReSharper won't have correct information. I'd try and configure it, close the solution and reopen.

VS2013 do not create a min.css

I have a LESS file that when saved ONLY updates the non-minified css file. No matter what I do it will not update the min file. I can of course minify the main via web essentials, but that sort of negates the function of compiling LESS on save...
There is no error or anything - it just happily ignores the min.css file. In VS2012 it works perfectly.
Does anyone have any idea of what to do about this?
/Erik
It can be done via setting: Tools -> Options -> Web Essentials -> LESS.
I found the answer here - How to ignore certain LESS files in Web Essentials LESS compiling? (Bootstrap)
Update:
This option must be set on CSS, see screenshot:
After this when you save LESS it will create a .min.css file too.

Create CSS File from Less File

I was hoping to find a way to create my css files from my less files using web essentials or something of the sort. When create a new less file it will create the css to match, however on some of my older files I removed the css files permanently and I am looking to readd them.
grunt-contrib-less is a great solution for continuously converting LESS to CSS, as is assemble-less (I'm a maintainer of the latter).
So I was able to answer my own problem. When using VS2012 Web Essentials your .less file will not compile and create the matching .css and .min.css if errors exist. My errors were occurring because some of my variables were not recognized due to the fact that I wasn't dragging in the #import of the my .less file that contained these variables. I took a quick look at the libraries you mentioned and they did look pretty cool. Thanks for the answer.
It's important to say that if you installed the Web Essentials plug-in you must restart the Visual Studio, otherwise the .min.css and .css will not be generated, either.

unable to write output file ... pdb visual studio 2010

From other answers to this same question, it seems that this error is secondary to the real problem which is a missing source file. I am not using any source control. I have looked through my entire project and don't see any files with a warning icon, indicating it's missing. If there IS a file missing, what is it missing from?
How can I find the "missing" file? Isn't there any way of resetting this? My whole project is stuck on this.
I had this too. Close VS and reopen. Don't compile. The errors list should tell you which file is missing.
I too had this problem. My project was building in release mode but was not working in debug mode. I checked for all necesary files are included in my solution and I found that there is one file missing Settings.Designer.vb in My Project folder. I included these file in project and it build file in debug mode also.
Make sure that all aspx files are available in your solutions, otherwise check WebSite.vbproj, make sure maybe there is a file that is missing from your code, either add this file to the solution, or remove it from WebSite.vbproj. I recommend for you to use Notepad++ to open and modify WebSite.vbproj
Regards,
Luai
Another possibility is the existence of corrupted compiled dlls for the actual project (i.e. bin/<project>.dll) In my case, I just deleted the .dll and the .pdb and recompiled and the error went away.
Deleting removed files from the Solution Explorer, then rebuilding, solved it on my computer.

Resources