Problems with compiling OLD-Projects
First, I decompiled the DLL file using DotPeak. Opened the .cproj file in Visual Studio. After searching for a solution to the problem on the Internet, I installed libraries 4.0 ( Microsoft.NETFramework. ReferenceAssemblies.net40 ) from the NuGet website into the frameworks folder. And this window as in the first screenshot disappeared. But after I compile the project, many errors appear like cs1525, cs 1002, etc.
So, how can I work with an old project in the current version of Visual Studio?
5 Replies
you don't have an old project
you have decompiler output, which is in most cases not valid C# source code
it's the decompiler's best guess at what the code looked like, which tends to include compiler generated code that isn't valid to write yourself
you'll need the actual source code unless you want to spend a lot of time cleaning up and rewriting the invalid parts and hoping you don't change the behavior
Interesting. So the decompiler will always produce errors?
if there is compiler generated code in the assembly, usually yes
Not always. It depends on the decompiler
If the compiled code was created from valid C# source, it stands to reason that it's possible to reverse-engineer it back to an equivalent C# source
But, decompilers can fail to correctly recognise what C# source was used to create a particular bit of compiled code
Got it, thank you very much.