I have followed the steps described in this question:
And so, i have this c# code:
using System;
using System.IO;
namespace ComLib
{
public class LogWriter
{
public void WriteLine(string line)
{
using (var log = new StreamWriter(File.OpenWrite(@"c:\log.file")))
{
log.WriteLine(line);
}
}
}
}
Under a solution named: RubyToCSharp
I checked the Register for COM interop in VS and created the following ruby code:
require "win32ole"
lib = WIN32OLE.new('RubyToCSharp.ComLib.LogWriter')
lib.WriteLine('calling .net from ruby via COM, hooray!')
And now i tried to run this ruby from powerShell and i keep getting this error:
./exmpl.rb:4:in `initialize': unknown OLE server: `RubyToCSharp.ComLib.LogWriter' (WIN32OLERuntimeError)
HRESULT error code:0x800401f3
Invalid class string
from ./exmpl.rb:4:in `new'
from ./exmpl.rb:4:in `<main>'
Any thoughts on what i am missing out over here?
EDIT
After checking if my dll was register according to this SO question, It seems that indeed my dll is registered, but still, the same error happens.
Really confused over here...