I just installed trail version of Visual COBOL with visual studio 2010 from Micro Focus. I am trying to compile one of my old COBOL programs into .NET assembly. When I compile, it creates .IDY file exension file in the bin floder. I want to decompile assembly to C# code. Is there anyway I can do this?
Thanks..
[Note: post from Micro Focus]
As the previous poster noted, the IDY file is only used to support the debugger.
If this is a managed code project (and you can create both managed and unmanaged (native) code in VS 2010 with Visual COBOL), then you will the assemblies in standard MSIL just like any other .NET language. Bear in mind this is not code that's intended to be human-readable and depends on the Micro Focus COBOL runtime so you can't reverse engineer the code to some other language such as C# (there may also be license agreement issues).
Try renaming it to *.dll, and load it into Reflector. If that fails, MicroFocus is doing something funky and that's not a .NEt assembly. This is probably not unreasonable. The .IDY file could be some form of pcode, which is interpreted by some runtime (that is real .NET code)
The .idy file contains data for debugging, so using reflector on it will not work just like reflector does not work on .pdb files.
Related
I'm new to Visual Studio Code (on Mac). We are using it to develop ASP.NET Core MVC applications in C#. When I hit F12 on a symbol, like classes, interfaces or variables, VS Code will jump to the definition of that symbol if the definition exists in the source files, sweet. However nothing will happen if the definition is from an external dependency. If I did this with Visual Studio on Windows, in this situation the default behaviour is jumping to the definition provided by its metadata. Is there a similar way in VS Code to do this, rather than doing nothing in this case? It would be very helpful during development.
The new OmniSharp C# extension for VS Code for >=.NET Core 1.0 now has this feature. If there is no source code available then jump to the definition provided by its metadata. (Since OmniSharp C# extension 1.6.0 for VS Code which I used. But the legacy OmniSharp C# extension for DNX doesn't have this feature)
I've browsed around StackOverflow but couldn't find any pratical solution to something that would seem to have such an easy solution: I had a bunch of .Net projects that were developed back in VS2005 or VS2008 and I imported them into VS2010. One of them is a C++ project, which currently targets framework 4.0 (not by my choice). One of our clients is having a problem running this application, the lack of a MSVCP100D.dll. I checked this thread what is MSVCP100D.dll? and the most accepted answer is simple: having the client install Microsoft Visual C++ 2010 Redistributable Package. However, the client is stubborn enough not to install it and I know for a fact that they have Microsoft Visual C++ 2008 Redistributable installed. So, if I'm correct in my conclusions and MSVCP100D.dll is new to VS2010, I could just target a previous framework version, rebuild the project in VS2010 and I'd be good to go. The problem is: how do I chance a VC++ target framework? I could find several guidelines to change C# and VB projects, but none about VC++. Any pointers?
Edit: To you guys who suggested that I compile it in Release mode: I am! It's been pointed out that the "D" stands for debug, which is rather strange.
Actually, you are using the debug version of the runtime (That's the "D"). Did you try compiling with a non-debug version?
Another possibility to consider would be to statically link with the runtime library. Your program will be larger, but will not have the DLL dependency.
Go into the project's properties.
On the lefthand side, go into Configuration Properties > General.
Look at the Platform Toolset value. Select v90 from the drop down list to target 2008.
See here for further details:
Visual C++ 2010 compatibility with VC 2008
See here for yet even more details:
http://blogs.msdn.com/b/vcblog/archive/2009/12/08/c-native-multi-targeting.aspx
Also as Dark Falcon mentions, that's the debug version of the runtime.
When I converted a VS 2005 project to VS 2010, with all projects still pointing to compile for the .NET 2.0 Framework, the dlls generated are a totally different file size. Is this normal or something to be concerned about?
The difference in file size is probably due to changes in the compiler shipped with the new version of Visual Studio. In theory, it should be more efficient. It should not be anything to worry about, but that doesn't mean you should forgo testing.
Microsoft does publish information on "Breaking Changes" with the new version of Visual Studio, e.g., http://msdn.microsoft.com/en-us/library/cc714070.aspx for VB, http://msdn.microsoft.com/en-us/library/bb531344.aspx for C++, and http://msdn.microsoft.com/en-us/library/ee855831.aspx for C#.
Is it possible to switch off managed code (and switch on unmanaged code) for c++ coding, so that programs (exes) made are run direct to native machine code in Visual Studio 2008?
Also, is it true that after the first time a .net (managed) exe runs (say written in C#) the exe gets converted to a native code one (like the old c++ ones pre .net)? Or is there a way to make it compile direct to native code if it was written in C#?
The answer to both of these questions is yes.
You can create unmanaged c++ code projects in VS which do not need .Net. You can also link unmanaged C++ code to managed C++ code and (sort of) get the best of both worlds - although the matching of calling parameters between the to systems is interesting.
You can also use the ngen .Net utility to pre-compile .Net projects to pure code. However in doing so you loose some flexibility. The JIT compiler will take account of local capabilities when compiling a .Net project. So if you distribute a .Net project as generated by VS then ngen on the local machine that runs the program will do the compiliing. However if you use ngen on your machine the precompiled code will be tied to the processsor capabilities of your system.
As per Joel's comment. regardless of using ngen or not, you still need .Net framework on the target machine.
In thinking about it, the use of ngen to pre-compile a .Net project probably is no worse than compiling an unmanaged c++ project to native code.
To do what you want for C#, you would use ngen.exe, which comes with the C# compiler. You run that command on the image, and it gets added to the GAC as native code.
As far as i know, you can switch temporarily to unmanaged code, i.e. using unmanaged variables etc. by marshaling. Take a look here: http://msdn.microsoft.com/de-de/library/bb384865.aspx
I am pretty new to programming. I would like to download an open source project and build it in my Microsoft Visual Studio 2008. In fact, I tried to import and build the application WinSCP:
https://sourceforge.net/projects/winscp/
But I didn’t work. Please can somebody help me and tell me which files do I have to download (from sourceforge) and how to import these into Microsoft Visual Studio in order to build the application. Thank you a lot. David
WinSCP seems to be written in Borland C++ Builder or whatever it's called today. It's not a standard C++ program and wouldn't compile in any other compiler because it uses special features only present in BCB. (It uses Delphi-style components, VCL and thus the __property keyword.)
Unfortunately, a lot of Open Source projects have very poor support for Microsoft's development tools. One project that comes to mind as being not too big and having workable MSVC project files is FreeType2, but that's a library and not an application, which probably makes it not very interesting for toying around with.
In support forum of winscp, they say, that you can't compile this project in Visual Studio.
Winscp appears to be a CPP project using a makefile instead of a sln file. VS uses SLN and *proj files to control builds and such. A good way to start would be to open VS, create a new console project (and solution) and go through some tutorials online.
If you really want to just see how a large project works in VS, grab something like IronRuby or IronPython or even something like the Witty twitter client.
In the general case, it is not possible to pour the C++ sources of a program into Visual Studio and expect it to work. C++ programming environments are far too different between operating systems for that. If you have a open-source program which builds and runs fine on Linux (for example), it may need several weeks (or months) or programming effort to make it run on Windows.