0

My application starts fine on my Windows 8 laptop. However I can not start it on Windows Server 2008 R2. Following error occured:

The exception unknown software exception (0xe0434352) occured in the application at location 0xfd5ecaed.

The following is printed in the command line:

Unhandled Exception: Cannot print exception string because Exception.ToString() failed.

My solution contains one c++-cli project which i'm trying to use, and if I do not use it then everything works fine, so commenting just this line helps:

// private static CliAdapterMain cliAdapter = new CliAdapterMain();

I've tried:

  • repair .NET Framework 4.5 on target machine
  • repair/reinstall VS 2012 Update 1 Redistributable (both x86 and x64, version 11.0.51106.1)
  • updated my VS2012 to Update 1 recompiled project
  • no Windows pending updates, tried to reboot system several times

Dependency Walker claims that following DLL's are missing: GPSVC.DLL IESHIMS.DLL MF.DLL MFPLAT.DLL MFREADWRITE.DLL WLANAPI.DLL However they exist on target computer, for example here

c:\Windows\winsxs\amd64_microsoft-windows-grouppolicy-base_31bf3856ad364e35_6.1.7601.17514_none_8649674dfda23046\gpsvc.dll

Probably I can try manually reregister missing dll's, but i don't think this is really a problem. Looking at an exception it seems that something is broken, not something is missing.

upd: From Windows logs:

Va.MBClient.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.TypeInitializationException Stack: at Va.MBClient.Program.Main(System.String[])

So I guess that private static CliAdapterMain cliAdapter = new CliAdapterMain(); is failed but i don't know why.

upd played with my application a little. Finally i've found just one line of code that causes a failure. This is #include <boost/thread.hpp>. Why this doesn't work? I'm using latest version of boost (1.52), but i did built it on my Windows 8 machine. Should I rebuilt everything for Windows Server 2008 R2? Should I built entire project on Windows Server 2008 R2?

pogorskiy
  • 4,705
  • 1
  • 22
  • 21
Oleg Vazhnev
  • 23,239
  • 54
  • 171
  • 305
  • 1
    Maybe this will be useful: http://stackoverflow.com/questions/5670248/boost-mutex-c-cli-problems I had the same problem. I solved it by moving all code working with boost::thread to the separate native DLL. – pogorskiy Nov 27 '12 at 08:09
  • @pogorskiy it's strange then that I can run on Windows 8 but can not run on Windows Server 2008 R2. because by this link people say that boost and CLR just not compatible. – Oleg Vazhnev Nov 27 '12 at 08:18
  • the question is what about other parts of boost? If i will avoid boost::thread will other parts of boost library work fine with clr? – Oleg Vazhnev Nov 27 '12 at 08:24
  • They write that the error is caused by specific `#pragma`s (`#pragma section(".CRT$XIU",long,read)` `__declspec(allocate(".CRT$XIU"))_PVFV p_tls_prepare = on_tls_prepare;`). Perhaps the behavior may vary depending on the platform. I strive to avoid the use of the system-dependent parts (such as a boost::thread or boost::asio) to get away from potential problems. It is better to move them to a separate native DLL – pogorskiy Nov 27 '12 at 08:37
  • @pogorskiy i wanted to use boost because in future I need to port to Linux application that now I need to launch on Windows. – Oleg Vazhnev Nov 27 '12 at 11:20
  • Use boost. Just separate the cross-platform kernel from the C++-CLI wrapper. – pogorskiy Nov 27 '12 at 11:37
  • @pogorskiy what does it mean? should I create one pure c++ library and on clr library that refer that c++ library? – Oleg Vazhnev Nov 27 '12 at 11:38
  • Yes, I solved the same problem in this way. Create a native С++ DLL library, hide the implementation details depend on Boost. Then, create a C++CLI wrapper for this library. – pogorskiy Nov 27 '12 at 11:46
  • @pogorskiy do you know if I have to create native DLL or I can also create native Static Library? – Oleg Vazhnev Nov 27 '12 at 12:18

1 Answers1

0

It is due to in the Windows Sever, some features is not enabled by default, you need to add the Windows Media Services and Wireless LAN Service by yourself to get the Dll back.

You can reference to MSDN

ray_linn
  • 1,382
  • 10
  • 14