This question already has answers here:
Closed 13 years ago.
Possible Duplicate:
Tool to convert java to c# code
I have done a project in java and I want to convert it to C#.Net. I'm using Visual Studio 2008. How can I convert the code from Java to C#? Are there any tools available?
There are tools that can help do this. For example this one from the team who created db4o:
Smart java to c# conversion for the masses with sharpen
Note that these are not perfect and some constructs and API's cannot be easily translated.
IKVM.NET Bytecode Compiler
Here is an Msdn Article about converting from Java to Visual C#.
I think your best shot would be, unless you really really need all the code in C#, to use Visual J# and integrate your Java code with C#.
Microsoft used to support their own .net implementation of the Java language, called Java#, but unfortunetelly they discontinued the project.
But at least you could try it to see if it could help you to convert your code to .net
Related
This question already has answers here:
Is there any way to compile Java code into a DLL?
(3 answers)
Closed 9 years ago.
I need to use Java code in .NET (C#) and am looking for a way to convert a Java class to a DLL file (which I can then reference in my .NET app). Is this a valid scenario? If yes, How can I do it?
You can use IKVM.NET to use Java classes and libraries from .NET.
Basically that is not a good idea. Since java emphasizes on platform independence, but dll is platform dependent. So, think about pack into a jar file, execute and consume it somehow
May be this link will be useful for you:
http://www.codeproject.com/Articles/13549/Using-Java-Classes-in-your-NET-Application
For this you can use IKVM.NET.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Best .NET obfuscation tools/strategy
Should you obfuscate a commercial .Net application?
Good day everyone.
I'm ready to release a small c# game, but I've heard that it is extremely easy to disassemble/decompile c# application if it is "deployed" as it is. So my question - what can I do to prevent, or at least make it harder for people to disassemble/decompile my application?
Is there more then one way? If so, what do you think is best?
UPD: As was pointed below using default obfuscator might pose some problem with reflections, because I use lua interpreter for ingame scripts.
Thanks in advance.
Visual studio contains the "Dotfuscator" (Tools->Dotfuscator Software Services in VS 2010) which obfuscates your code for you. It can pose certain problems if you implement reflection in your code, but it does give you options as to what you want it to do to your code, so there is some flexibility there as well.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
FindBugs for .Net
I need something like FindBugs for C#/.NET ...
Could you tell me where I can find something like this ?
Thanks.
FxCop is a static analysis tool for .NET that has the ability to detect various possible bugs as well as advise you of good programming practices and Microsoft naming conventions. It seems like Microsoft have stopped development on the standalone FxCop tool now in favour of encouraging you to buy a version of Visual Studio with the static code analysis built in (which I think for VS2010 is the "Premium" edition and above).
You might want to have a look at FxCop. It's probably the most popular static code analysis tool for .NET.
I've been looking for a free (as in "free beer") library that can parse C# 3.0 code (actually, C# 2.0 with lambdas would do it) and return some sort of AST/code DOM for a personal project. However, most alternatives I've seen up to now are inadequate:
Microsoft.CSharp.CSharpCodeProvider.Parse throws a NotImpementedException;
Visual Studio's "exposed" code parser sucks;
The ways of Mono's C# compiler are impenetrable (and next to not documented);
The C# Parser project at CodePlex only parses C# 2.0 code and thus we forget lambdas;
Another project on SourceForge claims to parse C# to CodeDOM, but it's 2000 days old so I guess it's not C# 3.0;
... and it goes on for several pages of Google results.
So... is there a free, working C# 3.0 parser out there, that can be plugged into another project?
Take a look at http://antlrcsharp.codeplex.com/
It is a C# 4 grammar for the Antlr parser generator.
I've had good luck with NRefactory, written in C# and used for the SharpDevelop IDE written for Mono:
http://wiki.sharpdevelop.net/NRefactory.ashx
How can Java support C# indexers?
It's not possible at this time, however this may provide you with some information on the currently accepted Java way (which unfortunately is just methods):
Java VS C# : Indexer
Good luck.