4 Replies - 759 Views - Last Post: 28 July 2017 - 02:30 AM Rate Topic: -----

#1 November-06  Icon User is offline

  • D.I.C Regular

Reputation: 53
  • View blog
  • Posts: 482
  • Joined: 04-January 11

ASP.NET Programatically Compile SCSS to CSS

Posted 19 July 2017 - 10:09 AM

I am compiling scss files to css files programatically using NSASS as I had trouble with initializing LibSassNet.

I am encountering problems with Nuget as it is being blocked by the web filter (new network policy). I then remove the Nuget package and reference the DLLs directly. Now, NSASS.Core wouldn't work unless the NSASS.Wrapper folder containing the x86 and x64 DLLs are placed in the output folder (in this case, the bin folder). It's now working fine when I debug it in VS.

But when deployed in server, it poses again the error on the wrapper not found (it detects proxy.dll instead of the x86 and x64 DLLs). Even when the required DLLs are there in the bin, it still won't work. My question is, "Is the bin folder also the output folder when already deployed in server?" I am guessing it's not treating the bin as output folder that's why files are not found. Or could there be another reason?

Also, with NSASS.Core, variables (e.g $primary), are not interpolated. This causes problem in my output. I hope someone could help on this.

I do not strictly require the use of NSASS.Core. If you have sugestions on other technologies to compile scss to css in .NET, I'll be glad to know. But as I can't use Nuget, hope you could suggest something that I can easily use with just DLLs.

Is This A Good Question/Topic? 0
  • +

Replies To: ASP.NET Programatically Compile SCSS to CSS

#2 Martyr2  Icon User is online

  • Programming Theoretician
  • member icon

Reputation: 5074
  • View blog
  • Posts: 13,697
  • Joined: 18-April 07

Re: ASP.NET Programatically Compile SCSS to CSS

Posted 19 July 2017 - 10:50 PM

Are you bent on having to absolutely use .NET? Because you can setup this sort of stuff using something like gulp or grunt and have it automatically compiled and all that as those files change (aka using watch). This process would work just fine in an ASP.NET application. You could even do things like tacking on timestamps for cache busting etc.
Was This Post Helpful? 0
  • +
  • -

#3 November-06  Icon User is offline

  • D.I.C Regular

Reputation: 53
  • View blog
  • Posts: 482
  • Joined: 04-January 11

Re: ASP.NET Programatically Compile SCSS to CSS

Posted 20 July 2017 - 09:54 AM

Thanks. Turned out that the DLLs are properly placed in bin. The C++ Redistributable package needs to be upgraded to 2013 in order to work.

I'll try to look into gulp or grunt for compiling scss as variable interpolation remains a problem in NSASS. I'll look into this more before making the switch though as I may be just missing some features. Thanks.
Was This Post Helpful? 0
  • +
  • -

#4 November-06  Icon User is offline

  • D.I.C Regular

Reputation: 53
  • View blog
  • Posts: 482
  • Joined: 04-January 11

Re: ASP.NET Programatically Compile SCSS to CSS

Posted 21 July 2017 - 02:40 AM

Found out that variables do get interpolated unless they're inside a calc() function. It seems that gulp users experience the same problem.

I have read some articles that an update to the version of SASS helps but I do not know how this can be done with NSASS.Core as all I did was reference the DLLs needed. Is it possible to see what version NSSAS.Core is using and maybe upgrade it?
Was This Post Helpful? 0
  • +
  • -

#5 November-06  Icon User is offline

  • D.I.C Regular

Reputation: 53
  • View blog
  • Posts: 482
  • Joined: 04-January 11

Re: ASP.NET Programatically Compile SCSS to CSS

Posted 28 July 2017 - 02:30 AM

Found out that not supported functions of SCSS in NSASS are supported by LibSassHost so I switch to using this library.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1