Problems encountered when using Ilspy to decompile a C # dll and how to handle it __c#

Source: Internet
Author: User
Tags reflector

Feel reflector than ilspy easy to use, but reflector charge. Ilspy often decompile something out of the mess. But in use, it is best to use the two together, because often decompile the code error, but do not know why, two contrast to know, like the following picture:

On the left is Ilspy, the right is reflector, two decompile results are not the same, the error is not the same.

1. Error CS0579
Error cs0579:duplicate ' Global::system.runtime.versioning.targetframeworkattribute ' attribute
CS0579 "Global::system.runtime.versioning.targetframeworkattribute" feature repeat
This problem is encountered when you add multiple projects that you decompile to a solution: Locate the AssemblyInfo.cs file for each project, and

[Assembly:targetframework (". netframework,version=v4.0 ", Frameworkdisplayname =". NET Framework 4 ")]

This comment out, then compile will not be a problem.

2. (Reflector) set get accessor decompile

public string username{get; set;}
/* Normal code * *
username= "David";
string Uname=username;

/* Reflector The result of decompile
/Set_username ("David");
String Uname=get_username ();

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.