Celtic Coding Solutions Blog

Celtic Coding Solutions Blog - for everything computer related

Fix - Unable to install Dot Net 3.5 (.Net) on Windows Server 2012 R2

Tried to install Microsoft SQL Server 2012 on a Windows 2012 R2 and had the following error:-

The following error has occurred:

Error while enabling Windows feature : NetFx3, Error Code : -2146498298 , Please try enabling Windows feature : NetFx3 from Windows management tools and then run setup again. For more information on how to enable Windows features , see http://go.microsoft.com/fwlink/?linkid=227143

OK simple enough I thought, so I just used PowerShell and ran:-

Install-WindowsFeature –name NET-Framework-Core

but that got to about 68% and failed.  OK maybe it needed the media (DVD/ISO) of the original VM creation.  So again tried the following PowerShell:-

Install-WindowsFeature –name NET-Framework-Core –source Z:\Sources\SXS

but again got to about 68% and failed - very odd as never had issues installing .Net 3.5 before on a modern server.  Looking around the internet it seemed if you had any of the following KB's installed from the Windows update it was a good idea to remove first:-

  • KB2966826
  • KB2966827
  • KB2966828

But I didn't have these installed as a fairly new server build.


The fix was fairly simple.  On the Server open Group Policy and open the following:- Local Computer Policy -> Computer Configuration -> Administrative Templates -> System

Find the Setting that says:-

Specify settings for optional component installation and component repair

Click Enabled and tick the box that says:-

Download repair content and optional features directly from Windows Update instead of Windows Server Update Services (WSUS)

Click apply and OK, then back in PowerShell run:-

Install-WindowsFeature –name NET-Framework-Core

And thankfully .Net 3.5 will now be installed.

Microsoft SharePoint 2016 Prerequisites Installation on Windows Server 2012 r2

Tried to install a fresh copy of Microsoft SharePoint on Windows Server 2012 r2 and had the following prerequisite failed:-

OK so looks like we need to install a few things:-

Install Windows Identity Foundation
Open Powershell (as Administrator)
Add-WindowsFeature windows-identity-foundation


Install the Microsoft Identity Extensions

Install Microsoft Sync Framework Runtime v1.0 SP1 (x64)

Windows Server AppFabric
Download the Windows Server AppFabric exe and save it to your Server. Then run the PreRequisiteInstaller from the SharePoint 2016 ISO (CD) using the following command line (as Administrator):-
prerequisiteinstaller.exe /appFabric:[Dir where you saved the AppFabric exe]\WindowsServerAppFabricSetup_x64.exe

Note- it will do a reboot after installation.

Install Microsoft ODBC Driver 11 for SQL Server

Install Microsoft WCF Data Services 5.6 (rename this download to WcfDataServices56.exe)

Install Microsoft Information Protection and Control Client (MSIPC)

Install IIS 6 Management Compatibility component
Open PowerShell (as Administrator)
Add-WindowsFeature Web-WMI


The following maybe needed, but it was not for me.
CU 1 for AppFabric 1.1 (KB2671763):

Then try installing SharePoint 2016 again and all should be well.

Excel Automation as a Scheduled task on Windows Server 2012 R2

Migrating some Excel Automated code using C# off an old Windows 2003 Server onto Windows Server 2012 R2 and using Scheduled Tasks to run I notice it was failing.  User linked to the Scheduled Task has correct permissions and it is being run with highest privileges.  Excel installed and I can run the code manually fine as that user.  Plenty of threads about the issue but the only thing that worked was:-


Windows 2008 +

Add 2 directories:-




Windows 2012 r2

Add 2 extra directories:-




SQL Server Database Backup Failure Operating system error 665

Had a SQL Server 2005 FULL Backup failure each night for the largest database (around 45GB).  Looking at the SQL Server Logs I notice the following error:-

BackupMedium::ReportIoError: write failure on backup device 'D:\BACKUP\SERVER_DATABASE_FULL_20160103_202215.bak'. Operating system error 665(error not found).

Looking at possible solutions:-
  • Backup HD drive is heavily fragmented, but as this is a SAN then that is not really possible.
  • Drive is compressed
Checking the drive and yes it was compressed so the network guys turned this off and bingo all we managed a full nightly backup.

Windows Server Essentials Connector just hanging after entering account

Following on from my post:-

Connecting Windows 10 to Windows Server 2012 R2 Essentials

I found running the Windows Server Essentials Connector Configuration Wizard was hanging after I entered the account and password details.  No error messages appeared, just stopped working.

Looking at the connector logs:-

C:\ProgamData\Microsoft\Windows Server\Logs (ProgramData is a hidden folder but it exists on Windows 10).

I opened the most recent txt file in this case it was called ClientDeploy.txt and noticed lots of errors relating to:-


A bit strange as the browsers work.


The fix was a bit simple really, the DNS setting on the Wifi was set to Automatic and pointing to the routers IP lets say however I needed to change the DNS setting to use the IP of the server lets say  Re-running the Essentials Connector and it went straight through.  I changed the DNS setting back to be Automatic and everything works as it should.

Installing Intel Graphics driver on Windows Server 2012 R2 Essentials

Setting up a Desktop PC as a Windows Server 2012 R2 Essentials Server and not able to install the default Graphic card driver from HP.  The setup will not work either from the Intel website, but this is an old i7 processor using the onboard Intel HD 2000 graphics processors.


First you need to install the Windows Server Essentials Experience

Server Manager -> Manage (Tab) -> Add Roles and Features

Click through until "Server Roles" and then tick the "Windows Server Essentials Experience" (near the bottom)

Server might need a restart

Then download the driver direct from Intel here I am using the x64 bit driver from:-

Intel HD Graphics 2000 for 2nd Generation Intel Core Processors

Just run the setup and all should install correctly.

Getting WiFi to work on Windows Server 2012 R2 Essentials

So I setting up an old Desktop PC as a Windows 2012 R2 Essentials Server.  I wanted to use WiFi to set it up as I am not near a network port, but every time I enabled the disabled WiFi adapter it kept disabling itself again.  Even using a USB WiFi card didn't work so a little poke around and it was a simple fix to get working.


You need to install the Wireless Lan Service in Server Features.

So Run Server Manager -> Manage (Tab) -> Add Roles and Features

Click through the wizard until you get to Features Section and tick "Wireless Lan Service" (near the botttom).

Might need a restart.

OK but wait the WiFi adapter is still disabled.  Quick check in Services:-

Server Manager -> Tools (Tab) -> Services

and I noticed the WLAN AutoConfig was not started.  Start this and bingo you can now connect using WiFi.

Connecting Windows 10 to Windows Server 2012 R2 Essentials

So setting up a new home server using latest Windows Server 2012 R2 Essentials.  Tried to connect to the domain using the Server Web Connect e.g. http://[ServerName]/Connect and I can see the webpage and download the connection exe e.g. ComputerConnect[ServerName].exe but I get the following error when running it:

Windows Server Essentials Connector Configuration Wizard

An Unexpected error has occurred. To resolve this issue, contact the person responsible for you network.


Seems like the Web Connect doesn't yet work for Windows 10. So you need to install the KB from Microsoft and install it on your Windows 10.

Windows Server Essentials Connector for Windows Server 2012 R2

Once installed in Windows 10 you have a new App.

Click Start, All Apps

Scroll down to "Windows Server Essentials" and run "Windows Server Essentials Connector Configuration Wizard".  Then run through the setup and all should be good.

SSRS Error System.InvalidOperationException: Operation is not valid due to the current state of the object.

SSRS 2005 running on Windows Server 2008 R2 had the following errors as reported on SSRS Logs:-

System.InvalidOperationException: Operation is not valid due to the current state of the object.

Seems to possible causes:-

Installation of Security Update for Microsoft .Net Framework 4 on Servers (KB2656351) and also having large number of parameters or form fields in a SSRS report.


Open Web.Config for ReportManager usual at:-

C:\Program Files\Microsoft SQL Server\MSSQL.2\Reporting Services\ReportManager 

Find <appsettings> in the file and add 2 new keys:-

<add key="aspnet:MaxHttpCollectionKeys" value="10000" />

<add key="aspnet:MaxJsonDeserializerMembers" value="10000" />

So you should see something like:-


    <add key="ReportViewerServerConnection" value="Microsoft.ReportingServices.UI.WebControlConnection, ReportingServicesWebUserInterface, Version=, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />

    <add key="ReportViewerTemporaryStorage" value="Microsoft.ReportingServices.UI.ReportViewerTemporaryStorage, ReportingServicesWebUserInterface, Version=, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />

    <add key="aspnet:MaxHttpCollectionKeys" value="10000" />

    <add key="aspnet:MaxJsonDeserializerMembers" value="10000" />


Also I recommend changing the Web.Config for ReportServer usual at:-

C:\Program Files\Microsoft SQL Server\MSSQL.2\Reporting Services\ReportServer

In this file there is usual no <appsetting> already added so just pop one under the </ConfigSections> part:-



<add key="aspnet:MaxHttpCollectionKeys" value="10000" />

<add key="aspnet:MaxJsonDeserializerMembers" value="10000" />


No need to re-start SSRS or IIS, it should just now be fixed.

Installing .Net Assemblies in GAC for Windows Server 2008 r2

I blogged about installing .Net Assemblies in GAC for Windows Server 2008 (Celtic Coding Linky), but for 2008 R2 it no longer works unless you change the Security Policy and re-boot the server (blogs.msdn.com).

This isn't really an option on a live server so I decided to use gacutil.exe.  Yes I abortion pill safety know this is not supported in a live environment but it works and late term abortions when under tight deadlines it is a proper option.

However this server had an old verion under:-


No problem give it a go in Command Prompt running as an administrator and get the following error:-

Failure initializing gacutil.


Looks like a .Net version difference so open gacutil.exe.config and change the following:-

<?xml version ="1.0"?>



        <requiredRuntime version="v1.1.4322"  />





<?xml version ="1.0"?>



        <requiredRuntime  safemode="true"  imageVersion="v1.1.4322" version="v1.1.4322"  />



        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

            <publisherPolicy apply="no"/>





Now try installing the dll

gacutil /i CCAssembly.dll


Assembly successfully added to the cache