Troubleshooting “An unexpected error occurred” message when using Remote Web Access to connect to computers

Troubleshooting “An unexpected error occurred” message when using Remote Web Access to connect to computers

  • Comments 33
  • Likes

[This post comes to us courtesy of Manish Kapoor from Commercial Technical Support]

We occasionally come across scenarios where memory consumption on an SBS Server increases and this may cause the server to run slow. Additionally, some of the services/features may stop working correctly.

You may find that trying to connect to computers or accessing shares from within RWA may fail with an error message similar to the one below:


Another symptom might be that you try clicking on a gadget in RWA and nothing happens.

If you check the event logs, you will find this warning:

Log Name: Application
Source: ASP.NET 4.0.30319.0
Date: 9/17/2013 15:31:28
Event ID: 1309
Task Category: Web Event
Level: Warning
Keywords: Classic
User: N/A
Computer: SBS.Contoso.local
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 9/17/2013 15:31:28 Event time (UTC): 9/17/2013 13:31:28 Event ID: 401c8120945a4115abb39de75d347aba
Event sequence: 5
Event occurrence: 1
Event detail code: 0

Application information:

Application domain: /LM/W3SVC/1/ROOT/Remote-1-130099878420126008
Trust level: Full
Application Virtual Path: /Remote
Application Path: C:\Program Files\Windows Small Business Server\Bin\WebApp\RemoteAccess\
Machine name: SBS

Process information:

Process ID: 5100
Process name: w3wp.exe

Exception information:

Exception type: InsufficientMemoryException
Exception message: Memory gates checking failed because the free memory (369917952 bytes) is less than 5% of total memory. As a result, the service will not be available for incoming requests. To resolve this, either reduce the load on the machine or adjust the value of minFreeMemoryPercentageToActivateService on the serviceHostingEnvironment config element.
at System.ServiceModel.Activation.ServiceMemoryGates.Check(Int32 minFreeMemoryPercentage, Boolean throwOnLowMemory, UInt64& availableMemoryBytes)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CheckMemoryCloseIdleServices(EventTraceActivity eventTraceActivity)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity)

There could be multiple contributors to the above problem. If you have applied .NET Framework 4.5.1 recently, you can work around this issue by modifying the Remote Web Access web.config file using the following steps: 

  • Open web.config file located at: “%ProgramFiles%\Windows Small Business Server\Bin\WebApp\RemoteAccess”.
  • Search in Web.config for "<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />", change this line to "<serviceHostingEnvironment aspNetCompatibilityEnabled="true" minFreeMemoryPercentageToActivateService="0"/>"
  • Save changes and close the file.
  • Run IISRESET from an elevated Command Prompt window

For more details on the root cause, information is available here:

You should not uninstall any versions of the .NET Framework that are installed on your computer, because an application in use may depend on a specific version of the .NET Framework. For more information, see The .NET Framework for Users in the Getting Started guide.

Note: If you don't have .NET Framework 4.5.1 installed and are still running in the issue described above, you may need to analyze the memory usage of different processes running on the server and fine tune them. In such a scenario, normal performance troubleshooting steps apply. Capturing a Performance Monitor log and comparing it with baseline performance throughput should be the right way to move forward.

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • You can also fix this with PowerShell rather than manually editing code.. Import-Module WebAdministration $apppools = get-itemproperty iis:\apppools\* foreach ($pool in $apppools) { if ((($pool.Name) -eq "ASP.NET v4.0")-or (($pool.Name) -eq "ASP.NET v4.0 Classic") -or (($pool.Name) -eq "SBS Client Deployment AppPool") -or (($pool.Name) -eq "SBS Web Applications application pool") -or (($pool.Name) -eq "SBS Web Workplace AppPool") ) { $pool.ManagedRunTimeVersion = "v4.0" $pool |Set-Item } else { $pool.ManagedRunTimeVersion = "v2.0" $pool |Set-Item } Restart-WebAppPool $pool.Name }

  • Thank you for posting this KB. This was perfect timing as I was working on this issue at a customer site. The fix worked.

  • Yeah, why do it the simple way when you can do it complicated wir PS.

  • Thanks for posting KB!

  • Won't let me save it.

  • Does anyone know how to save web.config I'm using Microsoft visual basic 2008 to edit the file I get The operation cannot be completed

  • To save web.config first copy it to your desktop make your changes then copy if back overriding the administrator by clicking continue

  • Awesome blog if need any type of problem of windows 7 so go through this site and fix your problem of any type of your problem
    Thank you
    Aalia lyon

  • I experience a likely common issue I will name "SQL Server Memory Creep" where the native installation will gobble up memory over time until it is consuming around half the total or more. A restart always smacks it back down for a bit, but it would be of use to limit the hungry hog.

    I have done some reading on the issue with most posts/articles advising against modifying or setting a hard ceiling on the native SQL Server memory consumption. If anyone has any quick and dirty ideas or can point one in the right direction to some useful information, I would be most appreciative.

  • " Microsoft OneNote EMR 2007" was pulled for security reasons, right? What about Direct EMR ( the Object Model, Gemini etc and those who took over when it was decided to keep OneNote like we discussed and to pull the OneNote 2007 EMR by Microsoft ( not the one you and Fritz advertised ), pull the plug on the planned release of OneNote to Apple etc.., the glitches etc?
    Do the execs who took over in the spring of 2010 know about these issues that I brought to your attention, Bill? Important stuff right? ( in

  • Try this. Ammyy Admin is a powerful multi-task solution for remote desktop sharing, remote computer administration and distance learning from any location in the World.

  • Great help, thanks, this fixed my issue

  • I can't access my shared folders remotely and I fixed it by running the command, IISreset on the Command Prompt as stated here:
    You should be under the Administrator account when doing this step. The information here has been helpful as well on understanding the issue.

  • This problem is associated with .NET 4.5 on SBS 2011, according to the following link:

    IISreset without the code change is only a temporary fix, maybe a few hours. This simple edit does the trick. Thank you for posting the fix!

  • Hope it will help, I will try it later