Friday, April 28, 2017

Episerver - Add SQL User through Aspx

Call this : Backdoor.aspx in Root folder 
Be sure to have SQL membership provider.
<%@ Page Language="C#" AutoEventWireup="true" %>
<% 

var user = Membership.CreateUser("Trump", "password123", "donald.duck@ajoke.us");
user.IsApproved = true;
Roles.CreateRole("Administrators");
Roles.AddUserToRole("Trump", "Administrators");

%>

Thursday, April 27, 2017

EPiserver - Cannot login with Domain Account when not on domain solution


EPiServer WindowsMembershipProvider does not work if you try to login with a domain account but do your machine does not have a working connection to your Domain Controller.
The Workaround is to creat a local account that is a member of the local administrators group. And use  this when your are not connected to your Domain Controller

Tuesday, April 18, 2017

Debugging - View Return Value within Immediate Window

Sometimes it can be good to see what the actually for instance formatted string return value actually became after return on an method.
This can be viewed from the Immediate Window when typing:

$ReturnValue

Friday, April 14, 2017

Windows - Missing Media Feature Pack

After some research it seems these media packs are very win version dependent. Information that is not so clear. For instance i run a Pro N edition and there seem to be a different package to download dependent on where what your windows version is right now. I don't really understand why Microsoft can bundle this or make the executable just download the right version for my Windows version. And when installing the package on wrong version it says its successful but its really not.

Windows 10 Version 1607


Media Feature Pack for N edition of Windows 10 Version 1703 (April 2017) Creators Update


There’s now three updates that supposedly fix this problem:
KB3010081 
KB3099229
Last One is extremely important and will be the solution to your problem KB3133719:

Friday, April 7, 2017

EpiServer - HTTP Error 403.14 - Forbidden - Solution


This is very common and can lead to unnecessary frustration.
Basically if no html page is received when trying to call a page it end up being handled as "no access".
So in EPisevers case this often means the site is probably actually working fine.
To fix this just append /episerver to the path and you can probably login then add the host name in
Administrator / Websites hostnames. And it will start working.


.NET Error - The CodeDom provider type “Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider” could not be located

Install-Package Microsoft.CodeDom.Providers.DotNetCompilerPlatformGAC location:

Copy to GAC from your project
gacutil -i "C:\*PATH TO YOUR APP CODE*\bin\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll"

Wednesday, April 5, 2017

Node - Bind Node or Gulp to System Path

Common error in this case:

'gulp' is not recognized as an internal or external command, operable program or batch file.
Solution:

PATH=%PATH%;C:\Users\**<username>**\AppData\Roaming\npm

Node Sass could not find a binding for your current environment :
Solution:
> npm rebuild node-sass

First Time or If the project has added NPM run:
npm install
npm install gulp -g
Möjligen också installera yarn.
Kör Remember:
Vid Deploy: Skriv: yarn run build 
Vid Test: Skriv:  yarn run dev
NO gulp command found: If nothing works  reinstall nodejs and then reinstall with gulp. However gulp doesnt support the new nodejs so NVM needs to set older version.

Monday, April 3, 2017

SCSS - Change Color of A Numbered CSS List

This can be done with the following code in SASS:
  ol {  
     counter-reset: li;  
   }  
   ol li {  
   }  
   ol li:before {  
     content: counter(li)". ";  
     counter-increment: li;  
     position: absolute;  
     left: 0;  
     top: 0;  
     margin: 0 0 0 -7px;  
     width: auto;  
     height: auto;  
     font-weight: bold;  
     color: orange;  
   }  


Sass Reminder:
pluset säger ju att "alla element som kommer efter element x"