A handy reference with different ways of deploying additional resources (e.g. sdf files) to the device/emulator for smart device unit test projects:
http://blogs.msdn.com/b/prativen/archive/2008/02/05/deployment-in-smart-device-unit-tests.aspx
Wednesday, April 18, 2012
Thursday, April 12, 2012
Unit testing smart device projects - TestContext error
A couple of days ago I started creating unit tests for a Windows Mobile smart device project that I have been working on in Visual Studio 2008. I generated a unit test method for one of the methods in one of the classes and attempted to run the test. This is when I ran into an error that took me several hours to solve, so hopefully posting this helps someone.
The test method failed to run due to the following error:
Error: System.ArgumentException: Object of type 'Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestAdapterContext' cannot be converted to type 'Microsoft.VisualStudio.TestTools.UnitTesting.TestContext'
Googling the error returned results that suggested it was caused by upgrading a test project from Visual Studio 2005 format to 2008, and that the reference to the UnitTestFramework.dll was still for the old version (8.0) and required updating. This did not apply to me as I had not upgraded my test project from VS2005. So I continued searching.
Microsoft.WindowsMobile.dll
Microsoft.WindowsMobile.Status.dll
C:\Program Files\Windows Mobile 5.0 SDK R2\Managed Libraries
C:\Program Files\Windows Mobile 6 SDK\Managed Libraries
The test method failed to run due to the following error:
Error: System.ArgumentException: Object of type 'Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestAdapterContext' cannot be converted to type 'Microsoft.VisualStudio.TestTools.UnitTesting.TestContext'
Googling the error returned results that suggested it was caused by upgrading a test project from Visual Studio 2005 format to 2008, and that the reference to the UnitTestFramework.dll was still for the old version (8.0) and required updating. This did not apply to me as I had not upgraded my test project from VS2005. So I continued searching.
After hours of searching for other causes for the error without success, I stumbled upon the following references in the smart device project:
Microsoft.WindowsMobile.Status.dll
Visual Studio was obtaining these references from the following folder:
However, the smart device project's target platform was the Windows Mobile 6 Professional SDK. I didn't notice this before as I did not originally create the smart device project. So I removed the references to the two DLLs and readded them from the following folder:
After rebuilding the smart device project, running the test method succeeded.
Also, in case you're wondering, test projects for smart device projects do not support the code coverage feature.
Categories:
.NET Compact Framework,
Microsoft,
programming
Saturday, March 31, 2012
Exe Crew DECA Day - 24/03/2012
Last week, Exe Crew hosted its first DECA day for 2012. For those that don't know, DECA is the Driver Education Centre of Australia and they have a facility in Shepparton, Victoria. This facility consists of a large concrete skid pan as well as some hill climb style tracks. The day was comprised of a series of courses on the skid pan and two different runs on the track. I was there to assist only and it gave me the opportunity to take some photos. Here are some photos and the full album can be viewed here - DECA 2012-03-24.
Categories:
cars,
DECA,
EXE Crew,
photography
Saturday, March 17, 2012
The cost of one extra turn of the ratchet
Years ago when I didn't really know my way around tools, I cross threaded one of the bolts for my passenger seat while installing a fire extinguisher bracket. The price I paid for my stupidity not only a cross threaded bolt, but the welded nut that screwed into had broken its welds and come away from the floor. So what I ended up with was a free spinning bolt that also moved up and down and didn't do much in terms of holding the seat down.
I finally sought advice from a couple of friends (Professor Dan and President JimJim) to find out how this issue could be fixed. Short of cutting a hole in the floor and welding a new nut on the underside, I was introduced to the use of a Nutsert - a threaded socket that you can insert and secure from the outside.
http://www.avdel-global.com/en/products/threaded-inserts/thin-sheet-nutsertr.html
So, the President helped me to fit the nutsert. Firstly, the old bolt had to be removed. This was a done by cutting the head off the bolt.
Done.
It was confirmed that the welded nut had broken off the underside of the floor.
For comparison, here is an undamaged hole where you can see the thread on the nut below the floor.
Next, the hole had to be enlarged slightly to accommodate the nutsert.
The nutsert used is an M10 x P1.5.
Finally, here it is fitted.
Thank you very much to the President and Professor for your guidance and help in cleaning up my mess.
Subscribe to:
Posts (Atom)















