From: "John R. Pierce" Date: 2003-09-27T21:46:49+09:00 Subject: Re: RubyDotNet r4 and namespaces > > On Sat, 27 Sep 2003 10:44:00 +0900, James Britt wrote: > If I run Learninga.rb, I get a WIndows message box, titled Microsof > Visual C++ Runtime Library, with the message > > Runtime Error! > > Program c:\ruby\bin\ruby.exe > > R6029 > -This program cannot run using the active version of the Microsoft > .NET runtime > Please contact that application's support team for more information. > > I'm thinking I have path or registry issues here, and may try to remove > earlier installations and simply use 1.1. (I've had annoying > experiences getting the framework installed, so I'm not convinced paths > and registry entries are entirely correct.) Ok -- I'd double check to see if you have a ruby.exe.config (or rubyw.exe.config) file in the ruby\bin folder. If you do, then it may be telling .NET to favor the 1.0 framework rather than the 1.1 framework (which is needed for the pre-built Ruby/.NET Bridge). Delete the configs if you have them or add .NET 1.1 as a supported runtime. If that isn't the case then I'd wonder if you can run any .NET 1.1 apps or if your 1.1 framework is busted. > Here's the class: > > using System; > using Neurogami; > using BlogtariDotNet; > > namespace Neurogami { > class Utils{ > public static void db( string msg ) { > Console.WriteLine( "[DBUG] " + msg ); > } > } > } > // namespace BlogtariDotNet { > class BlogtariSample { > static void Main( string[] args ) { > try { > DateTime today = DateTime.Now; > Console.WriteLine( "The time is " + today.ToString() ) ; > BlogtariSample bs = new BlogtariSample(); > Utils.db( bs.parse( "Foobar" ) ); > } > catch ( Exception exception ) { > Console.WriteLine( exception.Message ); > } > } > public string parse( string s ) { > return s + " "; > } > } > // } WOW, so the bugs live where the tests aren't. So, the .NET bridge will only load namespaces that have at least one public class. The example above could be fixed by making class BlogtariSample public (same for Utils). Interestingly enough, the bridge doesn't need the class to be public to access it (because we just don't honor access modifiers at all), but for some reason you need to have at least 1 public class in the namespace. We'll investigate and most likely fix in next release. Regards, John