tags:

views:

113

answers:

2

Microsoft's implementation of System.Net.Mail does not provide a robust mailing solution. I would like to use Mono's implementation of System.Net.Mail instead, however that namespace is embedded in the System.dll shipped with Mono, and has exact same namespaces as the original .net framework.

What I would like to do is instead extract System.Net.Mail from the mono solution and rename namespaces to Mono.System.Net.Mail. Then I can compile this in its own DLL and finally have a mailing solution that works!

Can anyone tell me how this can be done?

A: 

You might be able to use an extern alias (if you're using C#)

Damien_The_Unbeliever
Thanks but unfortunately this functionality is buggy in vs 2010.For example - create a new class library (framework v4), delete the reference to system. Add a new reference - browse to mono system.dll, add it, notice how the old System.dll is instead added to the project.
JL
Also after renaming files, got both system dll's in reference list, but won't compile - Error 1 An assembly with the same identity 'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' has already been imported. Try removing one of the duplicate references. d:\Mono-2.6.4\lib\mono\2.0\Mono.System.dll ClassLibrary1
JL
+2  A: 

Just check-out the code from svn repository (svn co svn://anonsvn.mono-project.com/source/trunk/mcs/class/System/System.Net.Mail), copy the classes you need into a new project, change the namespace and compile a dll yourself. Mono class libraries are licensed under MIT licence, so you just have to state that you use them in your final product licence and everything is fine.

skolima
Well I finally did it. Wasn't exactly a cake walk, but it wasn't too hard either.
JL