-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Detect default namespace when exporting an assembly as csproj #2272
Comments
What's the use case here? |
I de-compiled SB.exe , which is the IDE for the Small Basic programming language. With these attrs, the project is optimized, although I am using it in Debug Mode, so Putting Breaks points sometimes fails, and some breakpoints are ignored, making tracing and debugging nearly impossible. |
Yes, but, are you recompiling the assembly before debugging? ILSpy does not offer any binary editing capabilities... hiding attributes in the ILSpy output won't make them go away in the assembly... so, it would be easier to understand why you are asking for this, if you described your use case in detail... |
ILSpy saves the decompiled project. It can easily modify the file before saving it. |
ILSpy can show a dialog to ask us before saving the project, if we want to comment out these attrs, and give info about what happens if not. |
We had a bit of internal back-and-forth on this one. Current thinking: no, we expressly want to export the "original" (like with decompilation where we strive to get a near-identical version back), this "changing the code" should be a post-processing step after the export. |
I think exported code should be optimized for Debugging, while it is expected that most decompiled assemblies are optimized for Release. Keeping this as it is will cause a lot of suffering fpr most of the users. I am using .NET wince day 1, and I never aware of such attrs, s, what about beginners? |
For documentation purposes, this attribute has come up earlier #1422 (comment) |
Note that we actually already have such a transform for project decompilation: ILSpy/ICSharpCode.Decompiler/CSharp/Transforms/EscapeInvalidIdentifiers.cs Lines 81 to 104 in 08de841
It seems that the pattern has changed and is no longer recognized properly, so yes, this is actually a bug. Sorry, for the inconvience... |
@VBAndCs as this is now a bug, would you be able to provide an assembly were this bug is reproducible? I have tried with some assemblies, but cannot reproduce the bug. If you do not want to share the assembly publicly, please send it to [email protected]. Thanks! |
I am using ILSpy version 6.2.1.6137, but converted the project to VB.NET in a next step.
I am decompiling Microsoft Small Basic. You can install it (only 7 mega): Thanks. |
I am using win7 x32. Does this matter? |
Can you try the latest v7p2 compared to your currently installed v6.2.1? |
No, that should not make a difference. |
v7p2 works. Thanks. |
I can confirm that this did not work in 6.2.1. |
How should we detect the root namespace of the assembly? Would be nice, if you could suggest an algorithm for this. |
Let's talk about WPF as it has an indication: |
I just tested this using |
@siegfriedpammer |
The directory where xaml files are put is derived from the path given in the resource name. |
the AssemblyInfo info in the decompiled app contains these attrs:
Which cause troubles when debugging the app as if the app is in Release / optimized mode. Either remove them, or show us a hint to erase them. I lost a lot of time, and didn't get the reason until I asked folks in Roslyn .
The text was updated successfully, but these errors were encountered: