FaultInjection on Windows 2003

May 18, 2010 at 5:32 PM


I've been using the fault injection part of the API recently on
Windows 7. While I need to execute under Administrator, it's been
working great.

Today I tried to execute the sample on a Windows 2003 machine at work.
Sadly, it didn't work. While it didn't return any errors, it didn't
inject the fault either - exactly the same code-base as on Windows 7.

Any ideas why?



ps. By the way, testapi@microsoft.com isn't working :)

May 18, 2010 at 8:14 PM

Hi Ben, could you please let me know the following information about your windows 2003 machine:

1. Is it x64 or x32 bit OS?

2. Is it .net 2.0/3.5 or .net 4.0?

3. Is your app/sample x64 or x32?

4. There are logs file in your working folder, open the latest one and copy/paste here will help me to diagnose.



May 19, 2010 at 10:58 PM
Hi Bill, Thanks for your reply. It's a bod standard box. x32, .net 3.5 - sample app is x32. As for the log file, the only files created are .mfi and .rul ? I just tried it on Windows 2008 and I get this exception: C:\FaultInjectionSample_On_2003_With_Error\FaultInjectionSample\FaultInjectionSample\Build>FaultInjectionTest.exe Unhandled Exception: Microsoft.Test.FaultInjection.FaultInjectionException: Cannot find fault injection engine file "C:\FaultInjectionSample_On_2003_With_Error\ FaultInjectionSample\FaultInjectionSample\Build\FaultInjectionEngine\x86\FaultInjectionEngine.dll". Please check if the file exists, error code 0x3. at Microsoft.Test.FaultInjection.ComRegistrar.Register(String enginePathName) at Microsoft.Test.FaultInjection.ComRegistrar.AutoRegister() at Microsoft.Test.FaultInjection.FaultSession..ctor(FaultRule[] rules) at FaultInjectionTest.Fault(Int32 returnValue, String method) in C:\Documents and Settings\benh\Desktop\FaultInjectionSample\FaultInjectionSample\FaultInjectionTest\Program.cs:line 24 at FaultInjectionTest.Main(String[] args) in C:\Documents and Settings\benh\Desktop\FaultInjectionSample\FaultInjectionSample\FaultInjectionTest\Program.cs:line 13 However, the file does exist! :( I'll be happy to send you an email with the code... I'm sure it's an example you guys created. The fault method looks like this: public void Fault(int returnValue, string method) { ICondition condition = BuiltInConditions.TriggerOnNthCall(2); IFault fault = BuiltInFaults.ReturnValueFault(returnValue); FaultRule rule = new FaultRule(method, condition, fault); FaultSession session = new FaultSession(new FaultRule[] { rule }); Process.Start(session.GetProcessStartInfo("MyApplication.exe")).WaitForExit(); } Any ideas would be good. It's such a great concept it would be a shame not to be able to use it... :( Thanks Ben
May 20, 2010 at 8:25 AM

hi Ben, i guess your windows 2003 and windows 2008 does not have visual studio installed as your win7 machine where fault injection works? the error msg is kind of misleading. basically it could mean a lot of reasons. can you check my blog to see if it's the case?