How to disable SCSS compilation files in .NET Framework projects - css

I am developing an angular JS application with webpack using TypeScript and SCSS files, so when I compile the solution I want to VS not create .js and css files.
Adding these lines in the csproj of the projects the .js files are not created after compiling:
<PropertyGroup>
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
</PropertyGroup>
And now I want the same for the .css files.
I am using Visual studio Professional 2017.
The projects are developed using the version 4.5.2 of .NET Framework

Visual Studio does not do SCSS compilation by default. You've likely installed an extension which provides this functionality like the Web Compiler extension. Try disabling or removing the extension that is doing this to prevent the behavior.

Solution.
As Jimmy said, I have installed "BuildWebCompiler". After uninstall that nuget Packaged css files aren't generate when I compile the solution

Related

How to use Bootstrap in an ASP.Net Core 2.0 Application?

I know that Bower is not recommended to be used with ASP.Net Core 2.0. Instead, I used NuGet to download Bootstrap dependency into my project. Therefore, I can't reference the files in my Layout view like I used to do with Bower using:
<link href="~/lib/bootstrap/dist/css/bootstrap.css" rel="stylesheet" />
I am trying to use NuGet to get a cleaner code. However, I can't seem to be able to reference this package in my project. Anyone has an idea how to use/reference bootstrap installed through NuGet in an ASP.Net Core 2.0 application?
In .NET Core, Nuget is no longer suitable for deploying client files. This was a design decision made by Microsoft. Instead, you can use any of a host of client build/deploy tools like npm, or my preference is to simply link to the libraries you need st a CDN location. This eliminates deployment issues and offers better performance for your users.
In Visual Studio 2017 Preview, you can use Library Manager:
Library Manager (“LibMan” for short) is Visual Studio’s experimental
client-side library acquisition tool. It provides a lightweight,
simple mechanism that helps users find and fetch library files from an
external source (such as CDNJS) and place them in your project.
Soon it will available in VS stable version.
Add the "Package Installer" and "Bundler & Minifier" Extensions into Visual Studio (both created by Mads Kristensen)
Use the Package Installer to install client libraries using "npm" which is widely supported.
This downloads the files to a node_modules folder in the root of your web project.
Use Bundler & Minifier to copy/bundle/minify as you like for dev and/ or production from the node_modules folder to where you want them in the wwwroot folder.
First, install a nmp configuration file, and add bootstrap like in bower.json and save. Visual studio will download it. This is available for all packages. You can find the installed packages in the nmp node under the dependencies node of your project. Find more informations here

Different installation for bootstrap.sass nuget package for ASP.Net Core and Full framework projects

When i create an empty ASP.NET Web Application (.NET Framework) project with VS 2017 and install the bootstrap.saas nuget package (https://www.nuget.org/packages/bootstrap.sass), the package integrates within the project structure and the Content and Scripts folders are being created.
As the folders are within the project folder, i can easily work with them like compile them and minify them and copy the results into my wwwroot folder.
But when i create an empty ASP.NET Web Application (.NET Core) project with VS 2017 and install the bootstrap.saas nuget package, the package lands in the global nuget cache in the C:\Users\USER_NAME.nuget\packages\bootstrap.sass\4.0.0-alpha6\content folder and not in the project folder.
What is the best workflow/practice here to work with the nuget cache files and get them compiled and minified to the wwwroot folder within the .NET Core project?
Can i force nuget with an additional NuGet.Config file inside my project to install the package within my project folder or subfolder? Are there other options?
I know that i can use npm/webpack/gulp etc. for that but would like to do it the "old" way how Web Extension Pack did it for VS 2015 and like the Web Compiler (both from Mads Kristensen) do it now for VS 2017. Or do i run into a dead end using the Web Compiler?
Thanks
Can i force nuget with an additional NuGet.Config file inside my project to install the package within my project folder or subfolder? Are there other options?
If you want to change packages default location for .net core project, you can set "NUGET_PACKAGES" environment variable. Just Set "NUGET_PACKAGES" = "c:\teampackages". Or you can place a NuGet.Config file next to the solution with the following content:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<config>
<add key="globalPackagesFolder" value=".\packages" />
</config>
</configuration>
For the detail info, you can refer to this document and the same issue on GitHub.
However, what I want to say is that you might not be happy with the results.
Because .Net Core projects rely on so many NuGet packages. Almost hovering around 1GB. I think you will not want to set all those packages for each solution. Besides, with this change, you need to set up additional sources in VS for every solution. It`s quite inconvenient for .net core project.
This is the reason why NuGet team set the special settings for .net core projects. So how about add the Content and Scripts folders manually? It would not be very difficult.
Hope this can help you.

Compile Sass files in IIS7

I have encountered a problem in compiling Sass (.scss) files on IIS7. Is there any simple way to invoke the compilation? I have tried to add the MIME type but it wasn't working. Do I have to install something additional to IIS server?
I have also installed Mindscape instead of SassyStudio ad-on to Visual Studio and it did help because of dynamic .scss compilation. As you save .scss file, Mindscape generates .css file. But is there a posibility to run such compilation during deployment or on the IIS server?
Firstly Sass is a pre-processor, therefore must to be compiled to CSS to be used by the browser and IIS.
You have a few options:
Compile to css within Visual Studio and add the CSS to the project.
Have your build server/process compile to CSS before deploying to your environment. A common way to do this is with a Grunt or Gulp script.
Use BundleTransformer for Sass and create bundles with your .scss files. The transformer will output the bundle compiled to CSS.

TypeScript With Asp.net WebSite in VS2012

I have installed TypeScript plugin for VS2012 and could able to add a TypeScript file(.ts) to Asp.Net Web Application project and after making some modification to csproj it is generating .js(Javascript) file on build and is running perfectly.Now what i need is, to add A TypeScript file to Asp.Net Website Project,since the template is not available i added a .js file and renamed to .ts file and wrote TypeScript code there,but on build it is not generating corresponding .js file.So now the question is ,how to use TypeScript with Asp.Net Website in VS2012
You're going to need to install the Visual Studio 2012 plugin, as detailed here. It appears different versions of VS require their own plugins.

Xamarin Studio generate CSS from SASS or LESS files

I'm building a OWIN based Web-Application with Xamarin Studio on MacOS X.
How can I configure Xamarin Studio to build the CSS files from the LESS sources?
I have been looking for a solution to this myself. What I do now is I setup Grunt to do the compilation of the SASS files and run it in a command prompt.

Resources