tags:

views:

530

answers:

4

Hi,

I am using IKVM to get SVNKit on a Mono project I'm working with, I have a class that implements an interface from SVNKit, and I can't compile:

On windows and on .NET, everything compiles fine, just getting this on Mono.

/home/nubela/Workspace/subsync/subsync/Core/Subversion/PropGetHandler.cs(22,22): Error CS0535: Subsync.Core.Subversion.PropGetHandler' does not implement interface member org.tmatesoft.svn.core.wc.ISVNPropertyHandler.__<clinit>()` (CS0535) (subsync)

I googled __<clinit>() method, and it seems to be the initializer method for the base class in the Java library compiled from IKVM.

I have no clue how to proceed now, any idea guys? :)

A: 

If you have access to the code in Java library, then you can implemnt correctly method __().

Method void __() {} - compiles just fine. If that won't help can you provide a code sample that reproduces the error?

Vadmyst
The interface does not have __(), that __() is a method that IKVM uses for some base class initialisation, and has nothing to do with the Java code.
nubela
A: 

Since your class can build with Microsoft's compiler, this must be a bug in the Mono compiler or runtime.

You can use assemblies built with Microsoft's compilers with Mono on any platform.

I can suggest two work-arounds:

a) Build a helper assembly svnkitutil.dll on Windows. This would contain a default implementation of ISVNPropertyHandler and any other problematic interfaces. You would then implement the interface by subclassing the default implementation.

This might still fail with the same issue.

b) Modify the Java sources to remove the static field in the interface (ISVNPropertyHandler.NULL).

This might be a lot of work, if this is a common pattern throughout SVNKit.

Lachlan Roche
Yeah, but I dev on Linux, and I can't be rebooting everytime to compile.
nubela
@nubela: Virtual Machines are pretty useful for something like this...
Vinko Vrsalovic
A: 

I am going to ask an obvious question here..., but did you run your code through moma http://www.mono-project.com/MoMA ? I also got some really weird compiler errors which was caused by subtle incompatibilities (core methods not implemented etc).

Inuka G
Also, if missing stuff is found, submit a report at the end of the wizard, so they'll know what to fix.
Dykam
+1  A: 

I'm going to take a risk in alot of downvotes and suggest another solution, that is, for my opinion, much more better... I don't really understand why you are using Java libraries in a .NET application, if there are many alternatives in .NET, and good alternatives.

Why don't you use a svn library that is native for .NET, like Svn.NET? It would be much more faster. If you have existing code using SVNKit, you can convert it to Svn.NET or just create some wrappers for that.

A fish can't live outside the water, right? It can live only in its natrual environment, water. So, SVNKit, should live in its natrual environment either... Java, and not .NET. SVNKit in .NET is like human in Mars, and it is ok, but I would prefer human in the earth.

Svn.NET supports the following platforms:

  • .NET 2.0 on Win32
  • Mono on Win32 (2.0 framework)
  • Mono on Linux (2.0 framework)

Note that .NET/Mono 3.5 is just an extension to 2.0, so it will work either on 3.5.

Why to become entangled? It will be much more easier for you.

TTT
because. i used that, and it doesn't work. besides, it only supports legacy svn, and not the latest ones. so yes, there you go.
nubela
Well, you could use SharpSvn too.. there are alot of alternatives.http://www.thoughtspark.org/node/11
TTT