You are currently offline, waiting for your internet to reconnect

Your browser is out-of-date

You need to update your browser to use the site.

Update to the latest version of Internet Explorer

Access Violation of BEX or APPCRASH occurrs on Windows Server 2008 R2 with Terminal Service.

You may experience an Access Violation when your application:

- Uses Winsock API or crypto API, and may frequently load/unload a DLL dynamically.
- Is a multithreaded application.

When the Access Violation occurs, the following error message is generated. You may receive APPCRASH or BEX Event Error.

   Sample.exe Application has stopped working.

Problem signature :
Problem event name : APPCRASH
Application name : Sample.exe
Application version :
Application Timestamp : 4afa1ed3
Fault Module name : MSVCR80.dll
Fault Module Version : 8.0.50727.4927
Fault Module Timestamp: 4a2752ff
Exception Code : 40000015
Exception Offset : 000046b4
OS Version : 6.1.7600.
Locale ID:  1041

Problem signature :
Problem event name : BEX
Application name : Sample.exe
Application version :
Application Timestamp : 4afa1ed3
Fault Module name : mswsock.dll
Fault Module Version : 6.1.7600.16385
Fault Module Timestamp: 4a5bda77
Exception Offset: 000016bf
Exception Code : c0000005
Exception Data: 00000008
OS Version : 6.1.7600.
Locale ID:  1041
The root cause of this problem is a change made in Windows Server 2008 R2 to the time when the tsappcmp.dll module (Remote Desktop Services Application Compatibility DLL) gets initialized, which consequently causes your application to call DLL functions before it establishes a link to functions within the DLL.
To resolve this problem, do either of the following four options:

1. Exclude the application that has the error occurring from Data Execution Prevention (DEP).

2. Add the /TSAWARE linker option to build your application.

3. Add the /TSAWARE option with editbin.exe tool.

- Run Command prompt of Vistual Studio.
- Type following command.

editbin.exe /TSAWARE <Program file name>

- You can confirm that the program is aware of terminal service by following command.

editbin.exe /headers <Program file name>
  8540 DLL characteristics
      Dynamic base
      NX compatible
      No structured exception handler
      Terminal Server Aware

2229865 Change in TSAware Flag Behaviour in .NET Framework 3.5 SP1

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
Note This is a "FAST PUBLISH" article created directly from within the Microsoft support organization. The information contained herein is provided as-is in response to emerging issues. As a result of the speed in making it available, the materials may include typographical errors and may be revised at any time without notice. See Terms of Use for other considerations.

Article ID: 2279689 - Last Review: 08/02/2010 14:29:00 - Revision: 1.0

  • Windows Server 2008 R2 Standard
  • Windows Server 2008 R2 Datacenter
  • Windows Server 2008 R2 Enterprise
  • Windows Server 2008 R2 Foundation
  • KB2279689
amp;did=1&t="> var varCustomerTracking = 1; var Route = "76500"; var Ctrl = ""; document.write(" 0&did=1&t="> m=document.createElement('meta');'ms.dqp0';m.content='false';document.getElementsByTagName('head')[0].appendChild(m);" src=""> >>did=1&t=">