Set available buttons for TinyMCE Editor in EPiServer 8+

From this guide:
http://world.episerver.com/documentation/Items/Developers-Guide/Episerver-CMS/9/Content/Properties/Property-settings/

A toolbar looking like this (quite many buttons available):
Image 20160517 145713 001

Uses this TinyMCESettings C# code:

using EPiServer.Core.PropertySettings;
using EPiServer.Editor.TinyMCE;
using EPiServer.ServiceLocation;

namespace MySolution.Core.ContentEditing
{
    [ServiceConfiguration(ServiceType = typeof(PropertySettings))]
    public class DefaultTinyMCESettings : PropertySettings<TinyMCESettings>
    {
        public DefaultTinyMCESettings()
        {
            IsDefault = true;
            DisplayName = "Default settings";
            Description = "Default configuration as defined by the developers.";
        }

        public override TinyMCESettings GetPropertySettings()
        {
            var settings = new TinyMCESettings();

            settings.ToolbarRows.Add(new ToolbarRow(new string[]
            {
                TinyMCEButtons.EPiServerLink, TinyMCEButtons.Unlink, TinyMCEButtons.Image, TinyMCEButtons.EPiServerImageEditor, TinyMCEButtons.EPiServerPersonalizedContent, TinyMCEButtons.Separator,
                TinyMCEButtons.PasteText, TinyMCEButtons.PasteWord, TinyMCEButtons.RemoveFormat, TinyMCEButtons.Separator,
                TinyMCEButtons.TableButtons.Table, TinyMCEButtons.Separator,
                TinyMCEButtons.TableButtons.RowProperties, TinyMCEButtons.TableButtons.CellProperties, TinyMCEButtons.Separator,
                TinyMCEButtons.TableButtons.InsertRowBefore, TinyMCEButtons.TableButtons.InsertRowAfter, TinyMCEButtons.TableButtons.DeleteRow, TinyMCEButtons.Separator,
                TinyMCEButtons.TableButtons.InsertColumnBefore, TinyMCEButtons.TableButtons.InsertColumnsAfter, TinyMCEButtons.TableButtons.DeleteColumns, TinyMCEButtons.Separator,
                TinyMCEButtons.TableButtons.SplitCells, TinyMCEButtons.TableButtons.MergeCells
            }));
            settings.ToolbarRows.Add(new ToolbarRow(new string[]
            {
                TinyMCEButtons.Bold, TinyMCEButtons.Italic, TinyMCEButtons.EPiServerQuote, TinyMCEButtons.Separator,
                TinyMCEButtons.JustifyLeft, TinyMCEButtons.JustifyCenter, TinyMCEButtons.Separator,
                TinyMCEButtons.SuperScript, TinyMCEButtons.SubScript, TinyMCEButtons.BulletedList, TinyMCEButtons.NumericList, TinyMCEButtons.CharacterMap, TinyMCEButtons.Outdent, TinyMCEButtons.Indent, TinyMCEButtons.Separator,
                TinyMCEButtons.StyleSelect, TinyMCEButtons.Separator,
                TinyMCEButtons.Undo, TinyMCEButtons.Redo, TinyMCEButtons.Separator,
                TinyMCEButtons.Search, TinyMCEButtons.Replace, TinyMCEButtons.Separator,
                TinyMCEButtons.Code, TinyMCEButtons.Separator,
                TinyMCEButtons.Fullscreen
            }));

            // Add the default non-visual plugins that replaces built in functionality with EPiServer specifics.
            settings.NonVisualPlugins.Add("advimage");
            settings.NonVisualPlugins.Add("epifilebrowser");

            //if (PrincipalInfo.CurrentPrincipal.IsInRole("administrators"))
            //{
            //    //Chance to personalize. Let's allow administrators to access the html editor.
            //    settings.ToolbarRows[1].Buttons.Add("code");
            //}

            settings.Height = 200;
            settings.Width = 600;
            return settings;
        }

        public override System.Guid ID
        {
            get { return new System.Guid("a6fe936f-190d-45e2-b83c-ccc0501a7312"); }
        }
    }
}

 

How to solve 500 – Internal Server Error in ASP.NET: Troubleshooting Failed Requests Using Tracing in IIS 7 : The Official Microsoft IIS Site

If nothing of value comes up in your errorlogs or in the event viewer. Just follow this guide to enable Tracing in IIS7+

Source: Troubleshooting Failed Requests Using Tracing in IIS 7 : The Official Microsoft IIS Site

Troubleshooting EPiServer 7+ search indexing-service

Search index is located at:
directoryPath=”[appDataPath]\Index”
Index folder can be deleted, an then triggered by this tool (click start indexing).
Url: http://[mysite]/EPiServer/CMS/Admin/IndexContent.aspx
The index folder should now be created if all configuration is correct.

Troubleshooting: Troubleshooting EPiServer search indexing-service | Hans Kindberg

Setup and configuration for search: Svein Aandahl’s Blog: How to install EPiServer Search for EPiServer CMS 7

Deleting Data in SQL Server with TRUNCATE vs DELETE commands

TRUNCATE TABLE is a statement that quickly deletes all records in a table by deallocating the data pages used by the table. This reduces the resource overhead of logging the deletions, as well as the number of locks acquired; however, it bypasses the transaction log, and the only record of the truncation in the transaction logs is the page deallocation. Records removed by the TRUNCATE TABLE statement cannot be restored. You cannot specify a WHERE clause in a TRUNCATE TABLE statement, it is all or nothing. The advantage to using TRUNCATE TABLE is that in addition to removing all rows from the table it resets the IDENTITY back to the SEED, and the deallocated pages are returned to the system for use in other areas.

In addition, TRUNCATE TABLE statements cannot be used for tables involved in replication or log shipping, since both depend on the transaction log to keep remote databases consistent.

TRUNCATE TABLE cannot used when a foreign key references the table to be truncated, since TRUNCATE statements do not fire triggers. This could result in inconsistent data because ON DELETE/UPDATE triggers would not fire. If all table rows need to be deleted and there is a foreign key referencing the table, you must drop the foreign key and then recreate it.

Source: Deleting Data in SQL Server with TRUNCATE vs DELETE commands

Error when starting EPiServer 7.5+ site on server environments – Could not load file or assembly ‘JetBrains.Annotations, Version=

[FileNotFoundException: Could not load file or assembly ‘JetBrains.Annotations, Version=8.0.5.0, Culture=neutral, PublicKeyToken=1010a0d8d6380325’ or one of its dependencies. The system cannot find the file specified.] EPiServer.Framework.Initialization.InitializationModule.Initialize(HostType hostType) +1508 EPiServer.Framework.Initialization.InitializationModule.FrameworkInitialization(HostType hostType) +84 EPiServer.Global..ctor() +91 ASP.global_asax..ctor() +9

The workaround is to include the JetBrains.Annotations.dll in the bin folder of the application. 

Use Nuget package manager console to install the exact version missing. Select the Web project as the default project (to install into that project) in Package Manager Console and enter this command:

install-package JetBrains.Annotations -version 9.1.1.0

The above is for version 9.1.1.0, for more info regarding downloading old versions of nuget packages, see this link:
http://stackoverflow.com/questions/5628689/download-old-version-of-package-with-nuget

Read more here: Error when starting ASP.NET website – Language Agents / .NET Agent – New Relic Community Forum

Unpublish a page in EPiServer CMS 7+

Set content to expired:
– Toogle forms editing.
– Select “Tools menu” -> “Manage Expiration and Archiving”
– Expire date -> click “Now” link.
– Click save – content is now unpublished and not visible for visitors.
(Page status changes in top right corner changes to “Expired”).

Unpublished content = expired.
In the page tree view this red clock icon appears next to the Page:
Image 20160425 104325 001 Indicates that content has expired.

Video: Unpublish a page

Simple tool for analyzing IIS logs

The IIS server logs looks something like this:

#Software: Microsoft Internet Information Services 8.0
 #Version: 1.0
 #Date: 2016-04-19 00:47:15
 #Fields: date time s-sitename s-computername s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs-version cs(User-Agent) cs(Cookie) cs(Referer) cs-host sc-status sc-substatus sc-win32-status sc-bytes cs-bytes time-taken

This simple to use tool parses those logfiles and creates a html file that opens in the web browser and presents the data in a nice simple way complete with graphs.

Download “WebLog Expert Lite” for free.

Source: WebLog Expert Download