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 [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/MbUnitUser?hl=en
-~----------~----~----~----~------~----~------~--~---