Celtic Coding Solutions Blog

Celtic Coding Solutions Blog - for everything computer related

Asp.Net controls not keeping state on postback

Upgraded an Asp.Net project from Visual Studio 2013 to Visual Studio 2015 and then updated Telerik Controls from Version 2015.1.401.45 to 2015.2.826.45 and noticed none of my dropdowns, treeview controls where keeping state on postbacks.  I was binding data to these controls as per normal, but on postbacks they where losing state, so the dropdowns where empty and the chosen items where obviously not being kept.

Checked my Web.Config and I still had sessionstate active:-

<sessionState mode="InProc" cookieless="false" timeout="30" />


After much scratching of head I had another look at web.config and compared against a version in source control that was working and noticed this little gem:-

<pages enableViewState="false">

      <controls><add tagPrefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI" /></controls>


So looks like the upgrade either with telerik or Visual Studio added:-


After removing this my Asp.Net code worked again - phew!

Entity Framework SQL Server Version Error

Used Entity Framework 6 in Visual Studio 2015 and pulled all the table from the Development Database I needed.  They changed the Entity Framework SQL Configuration line in the App.Config (.Net Command Line App) and got the following error when trying to insert a record:-
The version of sql server in use does not support datatype 'datetime2'. entity framework

Check my SQL Database tables and I wasn't using DateTime2 in any fields.  OK this is a bit strange, the only difference is that Dev SQL Server is running SQL 2008 R2 and Live is still stuck on SQL 2005.

Right click on the *.edmx (Entity Framework Model) file and select "Open With..."
Select "XML (Text) Editor"
Near the top of the XML there is a section that looks like :-
<Schema Provider="System.Data.SqlClient" ProviderManifestToken="2008" Alias="Self" 
The catch here is the ProviderManifestToken is still on 2008, so change this to 2005 for SQL Server 2005 and the error should go:-
<Schema Provider="System.Data.SqlClient" ProviderManifestToken="2005" Alias="Self" 

Visual Studio Compiler error after changing application .Net target framework

Wrote an Asp.Net application using latest Visual Studio 2015 and target framework of .Net 4.5.2. but needed to re-compile it using just .Net 4.5 same as on the web server.  Usually fairly simple just open Applications Project properties and change the Target Framework, re-compile and any errors will be apparent.  However on running the Web App I see the following in the Browser:-

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS1617: Invalid option '6' for /langversion; must be ISO-1, ISO-2, 3, 4, 5 or Default

Source Error:

[No relevant source lines]


Kind of tells you why it is failing in the Compiler Error Message so check your Web.Config.  Find the section on <compilers> and check that is is correct.

Mine looked like this:-


  <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=, Culture=neutral, warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701">

  <providerOption name="CompilerVersion" value="v4.0"/>


Everything looks OK but the issue is in the section:-
compilerOptions="/langversion:6 /nowarn:1659;1699;1701"
So change this to:-
compilerOptions="/langversion:5 /nowarn:1659;1699;1701"

Recompile and all will be working again.

CSC.exe crash in Visual Studio 2015 when running Asp.Net project

Using Visual Studio 2015 and a Visual Studio Asp.Net Project I am increasingly getting 2 errors:-

CSC.exe has stopped working (APPCRASH):-

And CPU hitting 100% due to VBCSCompiler showing multiple times taking loads of memory too.


Close all instances of Visual Studio 2015 and if they don't do it automatically disappear, end tasks for all the VBCSCompiler processes.  In your Visual Studio project under Bin folder you will see a roslyn folder (new for VS 2015).

Delete the roslyn folder and all contents within.

Restart Visual Studio 2015, re-compile your project and all should be well again.

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.

Visual Studio 2015 and NuGet redirection and package retrieval errors

Using Visual Studio 2015 and trying to get a package from NuGet I was getting 2 errors:-

Install-Package : Too many automatic redirections were attempted.


An error occurred while retrieving package metadata for

I noticed there was a update for Visual Studio 2015 NuGet Package Manage for Visual Studio to version 3.1.60724.766 (from current 3.0.60624.657), so I downloaded and installed it.  Same errors.


In Visual Studio 2015.

Tools Menu -> NuGet Package Manager -> Package Manager Settings

Click Package Sources

Click + sign

Add the following:-

Name: something like NuGet v2

Source: https://www.nuget.org/api/v2/

Untick the current nuget.org so it should look like:-

And now you should be able to install NuGet packages

Visual Studio Performance And Diagnostics Service IISADMIN was not found on computer

Using Visual Studio 2013 and running the Debug - Performance and Diagnostics on my Windows 7 x64 PC I got the error:-

"Service IISADMIN was not found on computer"

I checked and I was running Visual Studio as Admin and IIS was running fine.

I did notice that I didn't have IIS 6 Management Compatibility enabled in the Windows Features.  So I turned these on and Performance and Diagnostics now works:-