Skip to content
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

Protected variables are being renamed, but shouldn't #103

Closed
horacioj opened this issue Oct 25, 2019 · 5 comments
Closed

Protected variables are being renamed, but shouldn't #103

horacioj opened this issue Oct 25, 2019 · 5 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@horacioj
Copy link

I was using version 1.0.0 without issues. In this version, public or protected members aren't renamed.

Using the latest v1.3.1 in this fork, the program fails because protected members are being renamed.
It is a web forms app. In a .ascx some protected members are referenced (defined in its code-behind file.

@mkaring
Copy link
Owner

mkaring commented Oct 26, 2019

Can you provide an minimal example to reproduce this?
It shouldn't rename protected members, unless the class is internal.

@horacioj
Copy link
Author

horacioj commented Oct 27, 2019

Sure! Please find a small project attached. Removed from the ZIP, under \ConfuserEx it should be the content of https://github.com/mkaring/ConfuserEx/releases/download/v1.3.1/ConfuserEx.zip

ConfuserExTest.zip

Build it and run .\Install\Confuse.bat

Then run the app and it will crash:
 


Server Error in '/' Application.
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. 

Compiler Error Message: CS0103: The name 'QsFileId' does not exist in the current context

Source Error:


Line 6:  <script type="text/javascript">
Line 7:  
Line 8:          var qsFileId = "<%=QsFileId %>";
Line 9:          var qsModuleId = "<%=QsModuleId %>";
Line 10:         

Source File: f:\wwwroot\ConfuserExTest\View.ascx    Line: 8 



Decompiling the DLL you can see the renamed variables:


using System;
using System.Web.UI;

namespace ConfuserExTest
{
    public class View : UserControl
    {
        protected string LYXQNat0i55RPHN$F8SXgoE
        {
            get
            {
                return 444.ToString();
            }
        }

        protected string UX5z5L2ukAZ2X49e1$VZgH0
        {
            get
            {
                return 555.ToString();
            }
        }

        public View()
        {
        }
    }
}

They are protected strings defined within a public partial class

Thanks!

@mkaring mkaring self-assigned this Nov 3, 2019
@mkaring mkaring added the bug Something isn't working label Nov 3, 2019
@mkaring mkaring added this to the 1.4 milestone Nov 3, 2019
mkaring added a commit that referenced this issue Nov 3, 2019
Protected properties are now not renamed anymore
in case they are visible outside of the assembly.
@mkaring
Copy link
Owner

mkaring commented Nov 3, 2019

Thank you for the example. I tracked the issue back. It was introduced by the changes for yck1509#462. I implemented the required changes. Please verify that the build you can download from the buildserver works for your actual project.

@horacioj
Copy link
Author

horacioj commented Nov 3, 2019

It works! Thank you for the quick fix.

@horacioj horacioj closed this as completed Nov 3, 2019
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants