Category: Uncategorized

WCF – An existing connection was forcibly closed by the remote host

If you’ve run in to the following error message in your WCF service:

System.ServiceModel.CommunicationException:    An error occurred while receiving the HTTP response to This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details.

You most likely already spent many hours trying to debug the exception. This happen to me and I searched Google and read through tons of threads, most about updating the following attributes in Web.Config/App.Config on the Server/Client:

  • maxReceivedMessageSize
  • maxStringContentLength
  • maxBufferSize
  • maxArrayLength
  • maxBytesPerRead
  • maxDepth

Others recommended enabling tracing on the client and on the server. None of these suggestions helped me… So I sat and banged my head against the wall for a few more hours and thought “What was different about this particular service method as compared to my other methods in my WCF service?“.

It turns out, my issues was actually really simple to resolve but the error message had nothing to do with the actual issue at hand. All the methods in my WCF service return custom entities (classes) and in this particular method one of the properties was of type DataTable.

The issue all along was that I wasn’t giving the DataTable a Name.

DataTable dt = new DataTable(“TheName”);

I hope this helps you guys save sometime.

Happy coding! 🙂

Windows 8.1 – Network Connectivity & new Start Button

Microsoft finally added the Start button to Windows 8.1 and I finally installed it.

Network Connectivity

After upgrading to Windows 8.1, I struggled with the Wi-Fi Network connectivity. In the Wi-Fi popup screen (click the Wi-Fi icon in the task bar) kept saying limited network connectivity with the little exclamation mark next to the Wi-Fi connection. It took me a while but I finally resolved the issue by opening Device Manager and uninstalling the Wi-Fi network drivers and then reinstalling them (reinstalling the drivers without uninstalling them from Device Manager first did not work for me).

Again, as I’ve said in the past, I really like Windows 8, this is not a bashing session. However, at the same time there are certain things about Windows 8/8.1 that just make me wonder “Why?”:

Pros & Cons IMO

1st, things I like about Windows 8.1:

1. I have a duel screen setup and my main screen is on the right side. I like that I no longer have to aim my mouse just perfectly at the bottom left edge of the main screen just to go to access the start screen because MS finally added a start button (I have issues with the start button too but more on that in the next section).

2. I like the new options and customization that you get from the metro GUIs.

3. The computer management menu where you previously had to right click the bottom most left edge of the screen now contains shutdown options (shutdown, sleep, hibernate, etc…) 

2nd, things I do not like about Windows 8.1:

1. In order to view the computer management (right click) menu, you have to right click the start button… it would have mad a lot more sense  if you just left click the start button and the menu appears.

2. The computer management (right click) popup menu is so plain and ugly… just seems like MS rushed to add it and didn’t spend anytime on it. MS should have invested just a little bit of time to make it look more integrated and pretty (similar to the Windows 7 popup menu without the “All Programs” menu & recent programs)

3. Start button brings you directly to the start screen instead of popping up a menu. I don’t understand why the start button simply brings up the start screen if there are many other methods to achieve the same thing:

  • Press the Windows Key on the keyboard
  • If the PC is a tablet (like a surface) just press the start button on the screen itself
  • Bring up the Charms > Start button

This is how the start button should work:

  • Double clicking should bring up the Start Screen
  • Single clicking should popup the computer management menu

Anyway, this is my two cents, thanks for reading.


Windows 8 Settings Gear Box Icon

I have to say, Windows 8 is really a great product but what would make it even better would be a Settings icon somewhere on the taskbar. Once you’ve used it for a few weeks and really get used to it, it starts growing on you. At home I only use Windows 8 but at the office we still use Windows 7 and Windows XP. This week for the first time I found myself sitting at my desk pressing the Windows Key trying to bring up my Start Screen and thinking to myself “wow, I totally forgot I’m on Windows 7, Duh!”.

I’ve seen a lot of threads with people complaining about Windows 8 mainly because of the missing start button and number of clicks it takes just to shutdown their PC. Anyway, this article isn’t to talk about how many click or taps it takes to do something rather it is a suggestion for Microsoft that I think would make a huge difference in the user experience. Most people I’ve spoke with don’t really care about the start button menu rather they want a quick way to access certain Windows Features. For example, there should be a way to enabled an icon or button somewhere on the taskbar that provides quick and easy  access to Power features, Control Panel, Search, and Administrative Tools (for the techy folk). The hidden menu at the bottom left hand corner of the screen just doesn’t cut it. This is especially true if you have dual monitors where the right monitor is your main and the left is your secondary. This is my setup and the mouse seems to always want to move over to my second screen so I have difficulty accessing the hidden menu… its such pain in that you know what. 

Here’s what I think would be a perfect solution to this problem. Add a Gear Box Icon to the bottom left of the screen where the old START button used to be and show a cut down version of the Start Menu. For example, here’s a mockup screenshot of what I think that menu should contain. We don’t need the program list or recent programs list on this menu. I really think this would improve the Windows 8 experience and also stop most of the commotion all over the internet relating to the start button.


Holla back if you agree,


Start Button App v1.1 for Windows 8

I’ve been using Windows 8 since the Consumer Preview and have really grew to love it. I’ve seen a lot of posts about people wish they could still have their start button in windows 8. Below is a freeware app I wrote for myself in .NET 4.5 that will provide similar functionality.

Here’s how you install it:

1.    Download the StartButtonApp_v1_1.7z files below and extract it to your desktop

2.    The zip program should create a directory called StartButtonApp and in that directory there should be a StartButtonApp.exe file

3.    Right click the StartButtonApp.exe and click Pin to Taskbar

4.    Move the StartButtonApp icon to the desired location on your taskbar and you should be all set


[EDIT: NunoP]

A newer version of the Start Button App was posted that allows users to customize the menuitems that get displayed. To modify the menuitems, simply open the menu.xml file and modify it as per your requirements.

Here’s what the default menu.xml file looks like:



name=Administrative Tools



position=1 />


name=Control Panel





name=Add/Remove Programs


arguments=shell32.dll,Control_RunDLL appwiz.cpl,,0

position=1 />


name=Display Properties


arguments=shell32.dll,Control_RunDLL desk.cpl,,3



name=Mouse Properties


arguments=shell32.dll,Control_RunDLL main.cpl,,0



name=Power Options


arguments=shell32.dll,Control_RunDLL powercfg.cpl



name=System Properties


arguments=shell32.dll,Control_RunDLL Sysdm.cpl



name=Device Manager


arguments=devmgr.dll DeviceManager_Execute









arguments=-s -t 00

position=1 />




arguments=-r -t 01



name=Log Off


arguments=-l -f




To add HIBERNATE and SLEEP, simply add the following two line of code underneath the Log Off element to the menu.xml file:









arguments=powrprof.dll,SetSuspendState 0,1,0



·      Now runs on top of .NET 3.5 (instead of 4.5)

·      The menu is now customizable via an XML file 

The StartButtonApp app is totally free so enjoy.

Nuno F. Pereira

‘Sys is undefined’ Error in .NET 2.0 and AJAX 1.0 Extensions

If you’re using ASP.NET 2.0 and try to use ajax, you may experience the error ‘Sys is undefined’. If this is the case for you, you’re most likely just missing some configurtion settings in your web.config. To fix your web application, just copy and paste the web.config settings that are missing in your app’s web.config file from the web.config file that’s in ASP.NET Extensions directory (mine is C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\v1.0.61025).

Start Button App for Windows 8

I’ve been using Windows 8 since the Consumer Preview and have really grew to love it. I’ve seen a lot of posts about people wish they could still have their start button in windows 8. Below is a freeware app I wrote for myself in .NET 4.5 that will provide similar functionality.

Here’s how you install it:

1. Download the files below and extract it to your desktop

2. The zip program should create a directory called StartButtonApp and in that directory there should be a StartButtonApp.exe file

3. Right click the StartButtonApp.exe and click Pin to Taskbar

4. Move the StartButtonApp icon to the desired location on your taskbar and you should be all set

Click this link to download the app: (7.88 kb)

Have fun with it and happy holidays! 🙂


ASP.NET Compilation Error – “[No relevant source lines]”

If you’re beating your head against the wall trying to figure out why you can’t run your ASP.NET web applications then you’ve come to the right place. This happen to my computer after removing a cycbot trojan. Here’s what you have to do to get it working again:


1.       Open Windows Explorer and browse to [root]:/Windows/Temp

2.       Right click the Temp folder then click Properties from the popup menu

3.       Select the Security tab

4.       Click Edit then Add

5.       Find and select IIS_IURS

6.       Click OK then select Full control then OK again


That’s it, test your ASP.NET app and it should compile and run error free.



Install Cisco AnyConnect VPN on Windows 8 x64

I’ve tested this on Windows 8 Pro x64 only (I’ve not tested this on x86 versions of Windows 8). Please make sure to backup the registry key we are going to modify in the instructions below before modifying it.

1.    You company will give you a URL where you can install the Cisco AnyConnect VPN Client from… In Windows 8 you might get “Page cannot be displayed” if you try to load the website via Internet Explorer 10. To properly install it successfully, useFirefox (IE will not work, not sure about Chrome)

2.    Edit your registry by pressing Windows Key + R

3.    Type RegEdit then press Enter

4.    Find HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\vpnva

5.    Double click on the DisplayName

6.    Delete everything before “Cisco AnyConnect VPN Virtual Miniport Adapter for Windows x64” and save the DisplayName value

7.    Test your VPN client and now you will no longer get a VPN driver error that you were getting on Windows 8


EDIT:   After a reboot, I received an error message but was able to get passed it by performing the following:

  1. Open the Services MMC (Window Key + R then type “services.msc” and press enter)
  2. Stop the Internet Connection Sharing (ICS) service
  3. Open the Cisco AnyConnect VPN Client and login



Change Windows 8 Enterprise to Windows 8 Pro

You can’t change the CD Key of Windows 8 Enterprise by going to the System screen. To change Enterprise to Pro, you need the Windows 8 retail CD along with your windows 8 Pro CD KEY. Popin the CD in your computer and reinstall windows however, when prompted what you want to do with your apps, files, and settings make sure you select the KEEP Settings, Apps, and Files!! It should be the default selected checkbox but make sure just in case.

Hope this helps other folks out there.

Could not load file or assembly ReportingServicesNativeClient

If you experiencing error “Could not load file or assembly ReportingServicesNativeClient” when you try to access Report Manager and/or Report Server in your SQL Server 2005 Reporting Services deployment, it’s most likely due to the fact that your Application Pool is configured incorrectly. More than likely you recently executed “cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 1” for some other project which ended up affecting SSRS without you even knowing it.


Here’s how I fixed this issue in my SSRS environment (please make sure to test this solution in your test environment before trying it on your production environment):

1.   Open IIS Manager 7+

2.   Click Application Pools

3.   Select “ReportServer” from the list of app pools then click Advanced Settings

4.   Under the General section find the property named Enabled 32-Bit Applications and set that to False

5.   Register x64 version of ASP.NET – C:\Windows\Microsoft.NET\Framework64\v2.0.50727>aspnet_regiis.exe -i

6.   Restart IIS

7.   Test Report Manager


If it still doesn’t work:

1.   Open the SSRS Configuration Tool and connect

2.   Click Report Server Virtual Directory

3.   Check mark Apply default settings then click the Apply button

4.   If the Web Service Identity doesn’t show a green checkbox, click on it then make sure both Report Server and Report Manager are both set to the ReportServer app pool


That should do it.