Click here to Skip to main content
15,898,035 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using an open source code from EvilDicom: http://evildicom.rexcardan.com/[^]. Unfortunately, these codes are in VS2010 and they use the namespace System.Numerics and Microsoft.CSharp.

I would like to know if there are equivalents of these namespaces in VS2008?
My application is built in VS2008 and hence I am trying to build it in 2008.

Thanks for the help.
Posted
Updated 4-Oct-11 20:44pm
v2
Comments
André Kraak 5-Oct-11 2:44am    
Edited question:
Added code tags
Formatted text/code
Spelling/Grammar
Corrected link

Glad you found what you were looking for.

Unfortunately System.Numerics is a .net 4 only thing.

VS2008 is using at most .net 3.5, it is very easy to switch to .net 4 and VS2010 and as far as your coding overhead is concerned there is none.

.net 4 can use all your existing .net 2+ DLL's as is, so you loose nothing.

The only problem you may have is the need to deploy .net 4 to your clients.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 5-Oct-11 2:31am    
I found quite an easy way -- without VS 2010. Please see my solution. It works!
--SA
Simon Bang Terkildsen 5-Oct-11 9:57am    
my 5
Well not in an easy way. As for System.Numerics it should be easy to refactor the code, search for BigInteger structures in the code and find a suitable data type available in 3.5, same for Complex structure (which requires more work).

For the Microsoft.CSharp the story will be a little bit different. As that namespace and lib contains only CSharpCodeProvider class which provides access to instances of the C# code generator and code compiler, I do not know how they used it and if that code is easily refactorable.

However, just check the code, maybe these libs are referenced but actually not used.

Let us know!

Cheers
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 5-Oct-11 2:30am    
Not easy? But I found quite an easy way. Please see my solution. It works!
--SA
Simon Bang Terkildsen 5-Oct-11 9:57am    
Got my 5
I just found a wonderful way to overcome this problem. Download source code of Mono — you will find source code of the Mono implementation of this unit. Mono is Open Source, and it will work with .NET.

Here: http://download.mono-project.com/sources/mono/mono-2.10.6.tar.bz2[^].

You can unpack the archive using 7zip: http://www.7-zip.org/[^].

—SA
 
Share this answer
 
Comments
Mehdi Gholam 5-Oct-11 3:49am    
Interesting... but I think it is too advanced for the OP, good to know they have completed the BCL compatibility.
Sergey Alexandrovich Kryukov 5-Oct-11 10:12am    
Thank you, Mehdi.

Not really too advanced. The source files are quite independent from the rest on Mono source code. Using them is not more difficult then using new .NET System.Numerics library available .NET Framework 4.0.
--SA
Simon Bang Terkildsen 5-Oct-11 9:56am    
5!
Sergey Alexandrovich Kryukov 5-Oct-11 10:13am    
Thank you, Simon.
--SA
I referenced the System.Numerics dll for the UIDHelper in Evil DICOM. If you have no need of generating UIDs, you can just delete the UIDHelper class from EvilDicom.Helpers.UIDHelper and retarget the whole library to 3.5.

Or if you want to still generate UIDs you can do it the old fashioned way: replace the following in the UIDHelper class:

C#
public static string GenerateUID()
{
    return string.Format("{0}.{1}", "2.25", GenerateSystemGuid());
}

public static string GenerateUID(string prefix)
{
    return string.Format("{0}.{1}", prefix, GenerateSystemGuid());
}

public static string GenerateUID(string countryCode, string vendorID, string suffix)
{
    return string.Format("{0}.{1}.{2}.{3}", "2.16", countryCode, vendorID, suffix);
}

private static string GenerateSystemGuid()
{
    Guid g = Guid.NewGuid();
    uint[] uints = new uint[4];
    Buffer.BlockCopy(g.ToByteArray(), 0, uints, 0, 16);
    return String.Join("", uints.Select(i => i.ToString()).ToArray());
}



-Rex Cardan
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900