Umbraco Build Error - New Installation From NuGet

One really annoying bug yet to be solved on a fresh install of Umbraco from NuGet in Visual Studio is the following build error:

CSC : warning AD0001: Analyzer 'Microsoft.CodeAnalysis.CSharp.Analyzers.FixAnalyzers.CSharpFixerWithFixAllAnalyzer' threw an exception of type 'System.TypeInitializationException' with message 'The type initializer for 'Microsoft.CodeAnalysis.Analyzers.FixAnalyzers.FixerWithFixAllAnalyzer`1' threw an exception.'.

This is really easily solved, 1 NuGet package needs updating to remove this issue, simply open Manage NuGet Packages go to the Installed tab and search for the following:

microsoft.codeanalysis.csharp

And them simply update to the latest version.

Hopefully they will roll this out as a fix eventually, I have raised this with them on their forums with no reply.

Save 20% on G Suite Basic or Business

Using one of my codes below you can save 20% off the first year of G Suite Basic or G Suite Business.

(These codes are on a first come first served basis)

My Referal Link (You must use this link for the codes to work):

https://goo.gl/45AhYh

Then use one of the following codes:

G Suite Basic Plan (20% off first year):

T9VL9673MF6KYX3

G Suite Business Plan (20% off first year)

AC44VKTGKGUYXNJ

Code highlighting the easy way

So after relaunching this site using Umbraco and the default Bootstrap 4 theme (blog) i realised there was no <code> highlighting included in bootstrap.

After some quick Googling i came across a very useful JavaScript library called highlight.js this library is able to auto match up to 176 languages and colour code them accordingly.

This seemed pretty nifty and much easier than codiing a ton of css myself.

To implement this you just need to add 3 very small lines into the <head> if the site:

<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>

Then wrap your code with the following:

<pre><code>...</code></pre>

If the auto highlighting doesn't work or you would like to use a different style you can manually set it like so:

<pre><code class="html">...</code></pre>

Or if you would like to disable code highlighting altogether:

<pre><code class="nohighlight">...</code></pre>

This is just a real basic implementation of this JavaScript library, take a look over on the project website to see about custom initialization, downloading the library and creating a custom library.

 

How to increase the Umbraco Media upload limit

If you need to increase the upload limit with Umbraco, this can easily be done if you have root access to your server.

You may have to contact your hosting provider if this is not the case.

First off, you need to update your Web.Config allow the file size you need...

Carry out a search for:

maxRequestLength

Then change the value to the file size you require in kb, for example 100MB in kb is 100000

Once you have made this change you need to update IIS to also increase the limit, there are 2 ways to do this...

First Way:

Navigate to:

cd %winsrv%\system32\inetsrv

and run this code:

appcmd.exe set config "sitename" -section:requestFiltering -requestLimits.maxAllowedContentLength:size in bytes -commitpath:apphost

Second Way:

Open Internet Information Services (IIS) Manager find your website under Sites and click on its name.

Then under IIS click on Request Filtering in this section on the right click on Edit Feature Settings

Then change the Maximum allowed content length (Bytes) in my case again 100MB is 104857600Bytes.

Click Ok and then restart your sites Application Pool

(Original Source)

Bye WordPress... Hello Umbraco