How to use the ‘Microsoft.ACE.OLEDB.12.0’ provider in a 64 bit application (with Office 32 bit installed on a 64 bit Windows OS)

8 בFebruary 2016

I recently came across a situation where I was running Visual Studio on a 64 bit operating system which had 32 bit Office installed on my machine and I was trying to compile a 64 bit project which uses the OLEDB provider.... this was obviously not a straight forward type of situation. At first, I was managing to compile my project in x86 platform configuration, but when I changed the configurations to x64 or AnyCPU I got the following error message: The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine. So in order to compile and run this 'messy' bitness situation,  you need to first...
no comments

Debugging: Process running under a debugger runs much slower than without, both in debug and release build configuration

26 בJanuary 2016

When a process is created under the debugger, the operating system by default uses the debug heap. The debug heap does more verification of your memory, especially at de-alloc. There are several possible options in order to disable the use of the Debug Heap: Attach to the process soon after startup. This will allow you to speed up performance in debug mode knowingly so and being fully aware of the mode in which you are running. Add the environment variable setting _NO_DEBUG_HEAP=1. This can be set either globally for the machine or for a specific instance of Visual Studio. a. Globally you would set...
no comments

Debugging: Trying to start a windows service in C# and getting the error message “Cannot open service on computer ‘.’.”

This is probably not an issue if you are running on an XP machine or under the debugger of Visual Studios, but only when you deploy your program on a Windows 7 machine you see the error: Cannot open < servicename > service on computer '.'. This is most likely because of the privileges change which occurred since Vista regarding the User Account Control. You can validate that this is indeed what is causing the issue if you try running the application as administrator and the issue does not occur. In order to Start or Stop a Windows services you need to run...
no comments

Debugging: WPF applications fail. Error code CS5001: The program has no suitable entry point.

All WPF Projects stop compiling, including newly added WPF template projects. I receive error code CS5001: Program does not contain a static 'Main' method suitable for an entry point. For me, this occurred after the installation of Update 5 in VS 2013, but I saw many reports online where this happened in other versions of VS and other updates as well. After checking the obvious: Compiling the projects on a different machine – if this compiles you can skip all the steps below. Basically rules out the project settings issues. Using different version of the .NET framework, 4.0 instead of 4.5, the same issue still...
no comments

How-to Debug native C++ projects from managed C# executable

13 בAugust 2015

This is another import 'How-to' which will helps debug a mixed mode solution, concentrating on debugging your native C++ library project and explaining the different ways which exist to break into your native projects code. If your C# executable is part of your solution, such as the start up project of your solution, then make sure to check the ‘Enable Native Code debugging’ check box in the properties -> debug of your project. If the C# executable is not part of the solution, you will run the executable and then attach the debugger to the running process.  You can do this by opening your...
no comments

How-to Configure your C++ Project in order to Debug in Release Configuration

Just thought I'd post a general 'How-to' for all those that need to debug a release build application. The following configuration will allow you to easily detect your problem. It will allow you to step through the code in order to find where the failure occurs, and then determine the incorrect parameters or code. Set the Projects C++ Configurations Settings Open the Property Pages dialog box for the project. (Right-click the project and select Properties.) Expand the C/C++ node and configure the following: Click the General node and set Debug Information Format to C7 compatible (/Z7) or Program Database (/Zi). Click the Optimization node and set Optimization to Disabled (/Ob) and Inline Function...
no comments

Debugging: LoadLibrary function returns NULL – error code 127

If you are calling the LoadLibrary function and it returns NULL, the first step thing you should do it call the GetLastError function in order to get receive the error code.  You can then look up the error code in order to get more information regarding why you the function is returning NULL. When looking up the error code 127 in MSDN your find the error message states "the specified procedure could not be found." First thing you should do, is check to see if the Dll you are searching for exists in the same locations as the exe file, if it does not there try adding it, and...
no comments

How-to Schedule a Build in Jenkins

10 בJune 2015

Under the job configuration we can define various build triggers. Simple find the ‘Build Triggers’ section, and check the ‘ Build Periodically’ checkbox.  With the periodically build you can schedule the build definition by the date or day of the week and the time to execute the build. The format of the ‘Schedule’ textbox is as follows: MINUTE (0-59), HOUR (0-23), DAY (1-31), MONTH (1-12), DAY OF THE WEEK (0-7) The letter H, representing the word Hash can be inserted instead of any of the values, it will calculate the parameter based on the hash code of your project name, this is so...

Debugging: Visual Studio 2013 take 4 times as long to build my project

17 בMay 2015

For several days I've been building my solution, with 30+ projects and have noticed that when building, rebuilding, or cleaning my solution building would take a very long time, about 4 times as long as other peers in my team. This occurred when trying to build using MSBuild as well as Incredibuild. I checked Incredibuild connectivity to server and all the build configurations both on the Incredibuild agent settings as well as in the VS build settings, all values were as expected. After scanning my computer for viruses and checking sufficient memory, I remembered that I had enabled the Fusion...

Managed C++ Class Properties appear invalid in the Watch Window

22 בJune 2014

You may have noticed that if you add a managed C++ class property to the watch window it becomes invalid immediately after being added. Along with this, if you try hovering with the mouse over the property in debug mode to evaluate the current value nothing is displayed.   If you try to do the same thing in Visual Studio using C#, the observed behavior is that it works normal and as expected. This particular behavior began occurring in managed C++ from Visual Studio 2005 and has remained this way till now.   Along with this, this behavior is actually considered to be 'By Design'.   This is because...
no comments