CrossNet is composed of several layers:
This API reads a .NET assembly and generates unmanaged C++ files.
CrossNetParser is based on top of Reflector, an Add-In is provided.
This C++ library is the core of CrossNet. You must compile and link this library against your generated C++ files.
CrossNetRuntime has a list of
predefined .NET types
already. The user cannot override them directly (except by changing CrossNetRuntime sources).
Additional things that you will need:
You will have to provide your own implementation of BCL
(Base Class Library - like collections, Console, Diagnostics, etc...).
Your assembly will certainly need this BCL assembly to be able to compile and link. You can provide the BCL in several manners:
- Use CrossNetSystem implementation.
CrossNetSystem is another open source project. As of September 2007, this is not yet recommended as the very few classes are supported, and the implementation is certainly not correct. But it is expected to improve over time.
- Use Mono's implementation. You can use CrossNetParser to transform Mono's BCL in C++, and integrate it in your process. I believe the Mono's license let you do that, you will have to check though.
- Write your own. This is a huge task, you really don't want to do that (but that's your choice). It would be better if you were contributing to CrossNetSystem.
Note that if you are implementing BCL (or any other class) in C++, you take the risk for your code to be broken if CrossNet's API change.
You won't have this issue if you are using C#.
Please do not disassemble Microsoft's BCL implementation (with CrossNet or anything else). I don't think you have the rights. Please don't do it.
In any case, there will be some technical issues - First CrossNetParser would generate incorrect C++ code in the most complex cases
of the Microsoft assemblies, and also one would have to implement many external methods. A lot of time will be spent modifying by hand the generated C++ code.
Instead, please contribute to CrossNetSystem.
Before you can execute any code in your assembly, you will also have to initialize CrossNetRuntime.
This initialization is mostly setting up the memory buffers and few callbacks, as well as implement the class System.Type.
You can find here more details:
If you have more questions (I'm sure you do), you can look at the code, examples, and unit-tests.
Don't hesitate to use the forums as well.