Hi Jeff, I finally got around creating a quick sample project that reproduces the error.
Here's what you'll need: - .NET Framework 1.1 + SDK - .NET Framework 2.0 + SDK (for NAnt) - J# Runtime for .NET 1.1 (for vjslib) The project contains everything else needed to build the sample ZIP library and the unit test. Just run "build.bat". The download is here: http://therightstuff.de/download/MbUnit-Zip-vjslib.zip Alex -- Alexander Groß http://therightstuff.de/ | -----Original Message----- | From: [email protected] | [mailto:[EMAIL PROTECTED] On Behalf Of Jeff Brown | Sent: Thursday, June 26, 2008 11:26 PM | To: [email protected] | Subject: MbUnit Re: Force .NET 1.1 runtime/MbUnit.Cons.exe fails with | vjslib.dll | | | Really bizarre. | | I wish I had some better suggestions to offer you, but it sounds so much | like the ZIP tests are somehow mangling the state of the MbUnit process. | Like something went and closed or redirected the console output stream | inadvertently. This might not be noticed in the GUI or TestDriven.Net since | the console output stream is not being used. | | Any idea what the contents of the exception to be printed were since it | looks like MbUnit.Cons.exe died while trying to print some other fatal | exception. | | Jeff. | | -----Original Message----- | From: [email protected] | [mailto:[EMAIL PROTECTED] On | Behalf Of Alexander Groß | Sent: Thursday, June 26, 2008 2:08 PM | To: [email protected] | Subject: MbUnit Re: Force .NET 1.1 runtime/MbUnit.Cons.exe fails with | vjslib.dll | | Thanks for the hints, Jeff. Unfortunately I was not able to solve the issues | so I created another assembly just for the tests that use vjslib and run | these with TestDriven.NET or the GUI (where no Exception is thrown, but a | report is generated -- see next paragraph). | | However I was able to determine exactly when the exception occurs. It | happens to be the case that the ZIP tests were the last tests executed in my | original test run. But the exception is not thrown when the ZIP tests run, | but rather when the report is generated. The report type and format and | using the NAnt <mbunit> task makes no difference. | | Alex | | -- | Alexander Groß | http://therightstuff.de/ | | | | -----Original Message----- | | From: [email protected] | | [mailto:[EMAIL PROTECTED] On Behalf Of Jeff Brown | | Sent: Wednesday, June 25, 2008 10:42 PM | | To: [email protected] | | Subject: MbUnit Re: Force .NET 1.1 runtime/MbUnit.Cons.exe fails with | | vjslib.dll | | | | | | I wonder if the ZIP file stuff in the Visual J# runtime library | (vjslib.dll) | | is mucking around with the console file handle for some weird reason. | | Alternately the pipe between NAnt and MbUnit.Cons is getting messed up. | | | | I wouldn't be too surprised if there were bugs in the VJ# library that | were | | fixed between v1.1 and v2.0. | | | | You might also try redirecting the console output stream of | MbUnit.Cons.exe | | in your NAnt script to a file. It's kind of a goofy hack but it might | work. | | | | Jeff. | | | | -----Original Message----- | | From: [email protected] | | [mailto:[EMAIL PROTECTED] On Behalf Of Alexander Groß | | Sent: Wednesday, June 25, 2008 7:23 AM | | To: MbUnit.User | | Subject: MbUnit Force .NET 1.1 runtime/MbUnit.Cons.exe fails with | vjslib.dll | | | | | | Hi all, | | | | I've got a .NET 1.1 project (customer requirement, don't ask) that | contains | | tests to be run under the .NET 1.1 runtime. On the dev/build machine | | there could also be a newer version of the framework installed so I | | have to | force | | MbUnit to run under a specific version of the .NET Framework. | | | | In order to force .NET 1.1 for the test run I edited the | | MbUnit.Cons.exe.config (I use MbUnit.Cons.exe to run the tests during | | a | NAnt | | build): | | | | <?xml version="1.0" encoding="utf-8" ?> <configuration> | | <runtime> | | <!-- Don't kill application on first uncaught exception. --> | | <legacyUnhandledExceptionPolicy enabled="1" /> | | </runtime> | | | | <startup> | | <!--<supportedRuntime version="v2.0.50727" />--> | | <supportedRuntime version="v1.1.4322"/> | | </startup> | | </configuration> | | | | The application contains a method that zips up data using the classes | inside | | vjslib.dll, which is an optional component for the .NET Framework 1.1 | | and 2.0. There's also a test that verifies that ZIP files can be | | generated by the application. | | | | As soon as this 1.1 setting above is in place MbUnit.Cons.exe fails in | | the instant the can-create-a-zip-file test is run. | | System.IO.IOException: "The handle is invalid" | | | | Here's the stack trace: | | | | mscorlib.dll!System.IO.__Error.WinIOError(int errorCode, string str) + | | 0x298 Bytes | | mscorlib.dll!System.IO.__ConsoleStream.Write(byte[] buffer, int | | offset, | int | | count) + 0x79 Bytes mscorlib.dll!System.IO.StreamWriter.Flush(bool | | flushStream, bool | | flushEncoder) + 0x99 Bytes | | mscorlib.dll!System.IO.StreamWriter.Write(char[] buffer, int index, | | int | | count) + 0x4c Bytes mscorlib.dll!System.IO.TextWriter.WriteLine(string | | value) + 0xcd Bytes | | mscorlib.dll!System.IO.TextWriter.WriteLine(System.Object value) + | | 0x68 Bytes | | mscorlib.dll!SyncTextWriter.WriteLine(System.Object value) + 0x1a | | Bytes MbUnit.Cons.exe!MbUnit.Cons.ConsoleClass.Main(string[] args) + | | 0x65 Bytes | | | | Other tests pass without complaining, and fusion log viewer shows that | | 1.1 assemblies are bound. When I click OK on the "Debug this application" | | window, MbUnit continues and displays that the ZIP test actually passed. | | | | If the supportedRuntime configuration is *not* set to 1.1 (default | | setting) my test also fails because the framework itself has a binding | | redirect for vjslib that redirects requests for the 1.1 vjslib to the | | 2.0 vjslib, if only the .NET Framework 2.0 is installed, but not the | | 2.0 | vjslib. | | | | I tried reverting the binding redirect that .NET 2.0 imposes, but to | | no | | avail: | | <runtime> | | <assemblyBinding xmlns="urn:schemas-microsoft- | com:asm.v1"> | | <dependentAssembly> | | <assemblyIdentity name="vjslib" | | | | publicKeyToken="b03f5f7f11d50a3a"/> | | <bindingRedirect | | oldVersion="0.0.0.0-65535.65535.65535.65535" | | | | newVersion="1.0.5000.0"/> | | <publisherPolicy apply="no" /> | | </dependentAssembly> | | <dependentAssembly> | | <assemblyIdentity name="vjscor" | | | | publicKeyToken="b03f5f7f11d50a3a"/> | | <bindingRedirect | | oldVersion="0.0.0.0-65535.65535.65535.65535" | | | | newVersion="1.0.5000.0"/> | | <publisherPolicy apply="no" /> | | </dependentAssembly> | | <dependentAssembly> | | <assemblyIdentity name="vjslibcw" | | | | publicKeyToken="b03f5f7f11d50a3a"/> | | <bindingRedirect | | oldVersion="0.0.0.0-65535.65535.65535.65535" | | | | newVersion="1.0.5000.0"/> | | <publisherPolicy apply="no" /> | | </dependentAssembly> | | </assemblyBinding> | | </runtime> | | | | Any ideas why MbUnit.Cons.exe fails with such a strange error? I could | | provide a sample if this would be of any help. | | | | I'm using MbUnit 2.4.2.130. | | | | Thanks, | | | | Alex | | | | | | | | | --~--~---------~--~----~------------~-------~--~----~ | You received this message because you are subscribed to the Google Groups | "MbUnit.User" group. | To post to this group, send email to [email protected] | To unsubscribe from this group, send email to MbUnitUser- | [EMAIL PROTECTED] | For more options, visit this group at | http://groups.google.com/group/MbUnitUser?hl=en | -~----------~----~----~----~------~----~------~--~---
smime.p7s
Description: S/MIME cryptographic signature
