Tuesday, May 24, 2016

Run Program as Administrator programmatically

I need to run a program as Administrator programmatically.

Fortunately googling this was so easy. Found this one:
Run Program As Administrator in vb.net


Open the Project Properties then click on View Windows Setting button. It will open the app.manifest file.

Using Squirrel to replace ClickOnce

Installing Squirrel

While I was searching for a way to make ClickOnce deploy easier after all hardship about certificate and identity errors, I bump into Squirrel.Windows. Thanks to Travis's comment in this question: Deploy a ClickOnce application without signing. Even though no one answer that was Marked ans Answer (yet at the time), the comments really help to give me an idea about some alternatives.

I create a new project that target a .Net Framework 3.5 and start searching for it in the Manage Nuget Packages for Solution.Current latest stable version is 1.4.0. I install it right away.


Create a new Nuget Package for my Visual Studio Application

To create a new Nuget Package, I must install the Nuget Package Explorer. If uses Internet Explorer, it will run immediately to install if click the Download button.

This is when I run it:



1. I just have to create a new package (Ctrl+N).

Monday, May 23, 2016

Trouble renaming IIS Website.

I have a web server. IIS on Windows Server 2008 R2. It'a a production server which runs many applications for my company.



Every time I open the IIS Manager I can see that "Defaults" as the name of my website. It really itch my eyes for month. But today I decided to change the name to something else.I think about name it the same as the domain name. So I try right-clicking the "Defaults". Owh, there's a "rename". Maybe I should try it.

Sunday, May 22, 2016

Success: Compiling LESS into CSS with Visual Studio 2015 via Web Compiler.

From the last time, I got disappointed for not successful in trying to produce a CSS file from a LESS using Web Compiler.

Reference: Attempt Compiling LESS into CSS with Visual Studio 2015 via Web Compiler.

I also tried the Bundle Transformer: LESS. but misunderstood that its a translator, not a compiler.

But this morning, after turning on my laptop, I open my last project. I try to re-compile my LESS file, of course using the Web Compiler. So strange because it works. It even generates the minified css.

Whats happening? I remember that I had restarted the Visual Studio many times. Do I have to restart my laptop? Is that it? I should think about that sooner. Wasted my precious hours on nothing. Arrgh.

By the way, I'm happy that it works. The usage is so easy.


ps: today I learned a very valuable lesson - restart my PC fist if any problem occur.

Attempt Compiling LESS into CSS with Visual Studio 2015 via Bundle Transformer: LESS

From the last time, I got disappointed for not successfull in trying to generate a CSS file from a LESS file using Web Compiler.

Reference: Attempt Compiling LESS into CSS with Visual Studio 2015 via Web Compiler.

Now I want to try the Bundle Transformer: LESS. Wish me luck.

I can install it from "Manage Nuget Packages for Solution.." in the Nuget Package Manager.



Attempt Compiling LESS into CSS with Visual Studio 2015 via Web Compiler.

So far, I only write CSS for my website presentation. But I heard that VS2015 can compile LESS to CSS and minify it. But I heard wrong. The feature is never in VS2015 but in the previous version that is in the VS2013. That is disappointing.

So I try searching for any extension on the net. Bumped to this in the VisualStudioGallery called Web Compiler. I decided to download and install it.

Then I just have to right-click on the LESS file (in Solution Explorer) and choose compile (right?).